short syntax in meta

This commit is contained in:
Dima Granetchi
2015-01-06 13:37:39 +02:00
parent eb67a67992
commit 8aadfd09f5
3 changed files with 6 additions and 3 deletions
+3
View File
@@ -19,7 +19,10 @@ class MetaUtils {
switch (p.expr) { switch (p.expr) {
case EBinop(OpAssign, e1, e2): case EBinop(OpAssign, e1, e2):
if (e1.toString() == name) res = { expr:e2.expr, pos:p.pos }; if (e1.toString() == name) res = { expr:e2.expr, pos:p.pos };
case EConst(CIdent(s)):
if (s == name) res = { expr:(macro true).expr , pos: p.pos };
case _: case _:
trace(p.expr);
Context.warning('Bindable arguments syntax error. Supported syntax: (flag1=true, flag2=false)', p.pos); Context.warning('Bindable arguments syntax error. Supported syntax: (flag1=true, flag2=false)', p.pos);
} }
if (res != null) break; if (res != null) break;
+1 -1
View File
@@ -301,7 +301,7 @@ class Bindable1 implements bindx.IBindable {
@:bindable(lazySignal=false) @:bindable(lazySignal=false)
public var str2:String; public var str2:String;
@:bindable(lazySignal=true) @:bindable(lazySignal)
public function bind() { public function bind() {
} }
+1 -1
View File
@@ -40,7 +40,7 @@ class ForceTest extends BuddySuite {
} }
} }
@:bindable(force=true) @:bindable(force)
class BindableForce implements bindx.IBindable { class BindableForce implements bindx.IBindable {
public var str(default, never):String; public var str(default, never):String;