added ESwitch support in Macro (close #29)

This commit is contained in:
Nicolas Cannasse
2015-05-20 20:08:44 +02:00
parent 0a9f147ab7
commit 0f0015ba44
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -1,3 +1,5 @@
import hscript.Macro;
class Test {
static function test(x,v:Dynamic,?vars : Dynamic) {
+2
View File
@@ -227,6 +227,8 @@ class Macro {
EObjectDecl(tf);
case ETernary(cond, e1, e2):
ETernary(convert(cond), convert(e1), convert(e2));
case ESwitch(e, cases, edef):
ESwitch(convert(e), [for( c in cases ) { values : [for( v in c.values ) convert(v)], expr : convert(c.expr) } ], edef == null ? null : convert(edef));
}, pos : #if hscriptPos { file : p.file, min : e.pmin, max : e.pmax } #else p #end }
}