Compare commits

...

7 Commits

Author SHA1 Message Date
Juraj Kirchheim
6f5eba983e Update travix. 2019-01-02 17:27:10 +01:00
Juraj Kirchheim
d5a44a9268 Release 0.17.3 2019-01-02 17:08:03 +01:00
Juraj Kirchheim
a11804c3ab Merge branch 'master' of https://github.com/haxetink/tink_macro 2019-01-02 16:59:06 +01:00
Juraj Kirchheim
380ceb39ea Add helper for transforming TypeParameter to TypeParamDecl. 2019-01-02 16:58:42 +01:00
Juraj Kirchheim
c48d445a54 Don't use get_field/set_field for field access anymore. 2018-11-08 11:27:37 +01:00
Juraj Kirchheim
b7e413d839 Release 0.17.2 2018-10-05 09:23:32 +02:00
Juraj Kirchheim
e1e487079b Add Exprs.as for ECheckType. 2018-10-03 11:50:21 +02:00
5 changed files with 32 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
-D travix=0.12.2
# @install: lix --silent download "gh://github.com/back2dos/travix#f46e67b6330d2e85b487a9fd512b10e4e0f1058f" into travix/0.12.2/github/f46e67b6330d2e85b487a9fd512b10e4e0f1058f
# @post-install: cd ${HAXE_LIBCACHE}/travix/0.12.2/github/f46e67b6330d2e85b487a9fd512b10e4e0f1058f && haxe -cp src --run travix.PostDownload
# @run: haxelib run-dir travix ${HAXE_LIBCACHE}/travix/0.12.2/github/f46e67b6330d2e85b487a9fd512b10e4e0f1058f
# @install: lix --silent download "gh://github.com/back2dos/travix#7da3bf96717b52bf3c7e5d2273bf927a8cd7aeb5" into travix/0.12.2/github/7da3bf96717b52bf3c7e5d2273bf927a8cd7aeb5
# @post-install: cd ${HAXE_LIBCACHE}/travix/0.12.2/github/7da3bf96717b52bf3c7e5d2273bf927a8cd7aeb5 && haxe -cp src --run travix.PostDownload
# @run: haxelib run-dir travix ${HAXE_LIBCACHE}/travix/0.12.2/github/7da3bf96717b52bf3c7e5d2273bf927a8cd7aeb5
-lib tink_cli
-cp ${HAXE_LIBCACHE}/travix/0.12.2/github/f46e67b6330d2e85b487a9fd512b10e4e0f1058f/src
-cp ${HAXE_LIBCACHE}/travix/0.12.2/github/7da3bf96717b52bf3c7e5d2273bf927a8cd7aeb5/src

View File

@@ -1,20 +1,20 @@
{
"name": "tink_macro",
"description": "The macro toolkit ;)",
"classPath": "src",
"dependencies": {
"tink_core": ""
},
"url": "http://haxetink.org/tink_macro",
"contributors": [
"back2dos"
],
"version": "0.17.1",
"releasenote": "Improve type parameter treatment. Add helper for getting field suggestions. Make type comparator available.",
"license": "MIT",
"tags": [
"tink",
"macro",
"utility"
],
"license": "MIT"
"classPath": "src",
"description": "The macro toolkit ;)",
"contributors": [
"back2dos"
],
"releasenote": "Add helper for transforming TypeParameter to TypeParamDecl.",
"version": "0.17.3",
"url": "http://haxetink.org/tink_macro",
"dependencies": {
"tink_core": ""
}
}

View File

@@ -43,8 +43,11 @@ class Exprs {
}
static public inline function is(e:Expr, c:ComplexType)
return ECheckType(e, c).at(e.pos).typeof().isSuccess();
return e.as(c).typeof().isSuccess();
static public inline function as(e:Expr, c:ComplexType)
return ECheckType(e, c).at(e.pos);
static public function finalize(e:Expr, ?nuPos:Position, ?rules:Dynamic<String>, ?skipFields = false, ?callPos:PosInfos) {
if (nuPos == null)
nuPos = Context.currentPos();

View File

@@ -9,7 +9,7 @@ abstract Member(Field) from Field to Field {
name: name,
pos: pos,
access: [APublic],
kind: FProp(noread ? 'null' : 'get_' + name, nowrite ? 'null' : ('set_' + name), t),
kind: FProp(noread ? 'null' : 'get', nowrite ? 'null' : 'set', t),
}
return ret;
}
@@ -202,4 +202,4 @@ abstract Member(Field) from Field to Field {
if (add != null)
this.access.push(add);
}
}
}

View File

@@ -247,4 +247,13 @@ class Types {
default: '';
}
static public function toDecl(p:TypeParameter):TypeParamDecl
return {
name: p.name,
constraints: switch p.t {
case TInst(_.get() => { kind: KTypeParameter(c)}, _): [for(c in c) c.toComplex()];
case _: throw 'unreachable';
}
}
}