File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -987,7 +987,8 @@ fn (mut g Gen) comptime_for(node ast.ComptimeFor) {
987
987
g.writeln ('/* attribute ${i} */ {' )
988
988
g.writeln ('\t ${node.val_var} .name = _SLIT("${attr.name} ");' )
989
989
g.writeln ('\t ${node.val_var} .has_arg = ${attr.has_arg} ;' )
990
- g.writeln ('\t ${node.val_var} .arg = _SLIT("${attr.arg} ");' )
990
+ g.writeln ('\t ${node.val_var} .arg = _SLIT("${util.smart_quote(attr.arg,
991
+ false)}");' )
991
992
g.writeln ('\t ${node.val_var} .kind = AttributeKind__${attr.kind} ;' )
992
993
g.stmts (node.stmts)
993
994
g.writeln ('}' )
Original file line number Diff line number Diff line change
1
+ module main
2
+
3
+ @[footer: 'Hello
4
+ World' ]
5
+ pub struct Config {}
6
+
7
+ fn test_main () {
8
+ $for a in Config.attributes {
9
+ assert a.arg == 'Hello\n World'
10
+ }
11
+ }
You can’t perform that action at this time.
0 commit comments