File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,20 @@ class ReactMacro
78
78
// TODO: consider giving warnings for isolated `&`
79
79
return result ;
80
80
}
81
+
82
+ static public function toFieldExpr (sl : Array <String >, pos : Position = null ): Expr {
83
+ if (pos == null ) pos = Context .currentPos ();
84
+ return Lambda .fold (
85
+ sl ,
86
+ function (s , e ) {
87
+ return e == null
88
+ ? (macro @:pos (pos ) $i {s })
89
+ : (macro @:pos (pos ) $e .$s );
90
+ },
91
+ null
92
+ );
93
+ }
94
+
81
95
static function children (c : tink.hxx. Children ) {
82
96
var exprs = switch c {
83
97
case null | { value : null }: [];
@@ -148,7 +162,7 @@ class ReactMacro
148
162
case [tag ] if (tag .charAt (0 ) == tag .charAt (0 ).toLowerCase ()):
149
163
macro @:pos (n .name .pos ) $v {tag };
150
164
case parts :
151
- macro @:pos (n .name .pos ) $p { parts };
165
+ macro @:pos (n .name .pos ) ${ toFieldExpr ( parts , n . name . pos ) };
152
166
}
153
167
154
168
var isHtml = type .getString ().isSuccess ();// TODO: this is a little awkward
You can’t perform that action at this time.
0 commit comments