EMapDecl + Map Comprehension

This commit is contained in:
NeeEoo
2024-04-25 04:14:41 +02:00
parent c0d4540d4b
commit b6df96a4b0
9 changed files with 432 additions and 127 deletions
+6
View File
@@ -239,6 +239,12 @@ class Macro {
EReturn(e == null ? null : convert(e));
case EArray(e, index):
EArray(convert(e), convert(index));
case EMapDecl(type, keys, values): // port to array decl, haxe still uses EArrayDecl but with => as a binop
var el = [];
for( i in 0...keys.length ) {
el.push( hscript.Expr.EBinop("=>", keys[i], values[i]) );
}
EArrayDecl(map(el,convert));
case EArrayDecl(el):
EArrayDecl(map(el,convert));
case ENew(cl, params):