Compare commits
9 Commits
kevinresol
...
0.13.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
32aa2d6570 | ||
![]() |
d81642e733 | ||
![]() |
d5f4987ddb | ||
![]() |
671f1bc995 | ||
![]() |
b1012937fc | ||
![]() |
bd4b8c436f | ||
![]() |
dbebd0d70d | ||
![]() |
4c523e02a5 | ||
![]() |
f39fc3b296 |
26
.travis.yml
26
.travis.yml
@@ -2,18 +2,26 @@ sudo: required
|
||||
dist: trusty
|
||||
|
||||
language: haxe
|
||||
|
||||
haxe:
|
||||
- "3.2.1"
|
||||
- development
|
||||
|
||||
- 3.2.1
|
||||
- development
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- haxe: development
|
||||
|
||||
- haxe: development
|
||||
|
||||
install:
|
||||
- haxelib install travix
|
||||
- haxelib run travix install
|
||||
- haxelib install travix
|
||||
- haxelib run travix install
|
||||
|
||||
script:
|
||||
- haxelib run travix node
|
||||
- haxelib run travix node
|
||||
|
||||
env:
|
||||
secure: T4SCtY5qmEsK1ARWPevJmqLm23tv4CobLrbPOQV3FsoQno7FCP1S/+9GmuoJKzeTjWMzdTeDsp8TVwZ6AyGjvhl2nZNjhU+QTsir4tfbYYRyvsz/QK6pveFbPQVv7OsnnaB4wbZtqGZ8mzFeQf7Ol4tsNe7iUFJb/iVc+4/lUxo=
|
||||
|
||||
deploy:
|
||||
provider: script
|
||||
script: haxelib run travis release
|
||||
on:
|
||||
tags: true
|
@@ -11,8 +11,8 @@
|
||||
"contributors": [
|
||||
"back2dos"
|
||||
],
|
||||
"releasenote": "Fix issue with .toComplex()",
|
||||
"version": "0.12.2",
|
||||
"releasenote": "Alias for TypeMap",
|
||||
"version": "0.13.2",
|
||||
"url": "http://haxetink.org/tink_macro",
|
||||
"dependencies": {
|
||||
"tink_core": ""
|
||||
|
@@ -5,6 +5,7 @@ import haxe.macro.Expr;
|
||||
import haxe.macro.Type;
|
||||
import tink.macro.TypeMap;
|
||||
|
||||
using tink.MacroApi;
|
||||
using haxe.macro.Tools;
|
||||
|
||||
typedef BuildContextN = {
|
||||
@@ -104,7 +105,7 @@ class BuildCache {
|
||||
usings: ctx.usings
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
static public function getType(name, ?type, ?pos:Position, build:BuildContext->TypeDefinition) {
|
||||
|
||||
if (pos == null)
|
||||
@@ -156,18 +157,29 @@ private class Group {
|
||||
usings: usings,
|
||||
name: path.split('.').pop()
|
||||
});
|
||||
|
||||
Context.defineModule(path, [def], usings);
|
||||
|
||||
entries.set(type, { name: path } );
|
||||
Context.defineModule(path, [def], usings);
|
||||
return Context.getType(path);
|
||||
}
|
||||
|
||||
|
||||
function doMake()
|
||||
while (true)
|
||||
switch '$name${counter++}' {
|
||||
case _.definedType() => Some(_):
|
||||
case v:
|
||||
return make(v);
|
||||
}
|
||||
|
||||
return
|
||||
switch entries.get(type) {
|
||||
case null:
|
||||
make('$name${counter++}');
|
||||
doMake();
|
||||
case v:
|
||||
Context.getType(v.name);
|
||||
switch v.name.definedType() {
|
||||
case Some(v): v;
|
||||
default: doMake();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -57,7 +57,7 @@ class Sisyphus {
|
||||
case null:
|
||||
null;
|
||||
case TMono(_.get() => t):
|
||||
t == null ? null : toComplexType(t);
|
||||
t == null ? Types.toComplex(type, { direct: true }) : toComplexType(t);
|
||||
case TEnum(_.get() => baseType, params):
|
||||
TPath(toTypePath(baseType, params));
|
||||
case TInst(_.get() => classType, params):
|
||||
|
@@ -13,6 +13,16 @@ using tink.macro.Functions;
|
||||
using tink.CoreApi;
|
||||
|
||||
class Types {
|
||||
|
||||
static public function definedType(typeName:String)
|
||||
return
|
||||
try {
|
||||
Some(Context.getType(typeName));
|
||||
}
|
||||
catch (e:Dynamic)
|
||||
if (Std.string(e) == 'Type not found \'$typeName\'') None;
|
||||
else neko.Lib.rethrow(e);
|
||||
|
||||
static var types = new Map<Int,Void->Type>();
|
||||
static var idCounter = 0;
|
||||
static public function getID(t:Type, ?reduced = true)
|
||||
|
Reference in New Issue
Block a user