[macro] signal macro expression wrap with function

This commit is contained in:
2019-02-27 12:26:37 +03:00
parent d4aeffb8a6
commit 71995ef672
2 changed files with 13 additions and 9 deletions

View File

@@ -154,7 +154,12 @@ class TemplateMacro {
var value = createValue(name, key, Reflect.field(data, key), position, exprs);
if (value != null) {
if (key.charAt(0) == "+") {
exprs.push(Context.parse('${name}.${key.substr(1)}.connect(${value})', getPosition(position)));
var e:Expr = Context.parse(value, getPosition(position));
e = switch (e.expr) {
case ECall(_, _): macro function(_) ${e};
case _: e;
}
exprs.push(macro $p{[name, key.substr(1)]}.connect(${e}));
} else {
exprs.push(Context.parse('${name}.${key} = ${value}', getPosition(position)));
}