mirror of
https://github.com/vlang/v.git
synced 2025-09-11 00:20:26 -04:00
parent
a3180e5747
commit
94a91c263e
@ -987,7 +987,8 @@ fn (mut g Gen) comptime_for(node ast.ComptimeFor) {
|
|||||||
g.writeln('/* attribute ${i} */ {')
|
g.writeln('/* attribute ${i} */ {')
|
||||||
g.writeln('\t${node.val_var}.name = _SLIT("${attr.name}");')
|
g.writeln('\t${node.val_var}.name = _SLIT("${attr.name}");')
|
||||||
g.writeln('\t${node.val_var}.has_arg = ${attr.has_arg};')
|
g.writeln('\t${node.val_var}.has_arg = ${attr.has_arg};')
|
||||||
g.writeln('\t${node.val_var}.arg = _SLIT("${attr.arg}");')
|
g.writeln('\t${node.val_var}.arg = _SLIT("${util.smart_quote(attr.arg,
|
||||||
|
false)}");')
|
||||||
g.writeln('\t${node.val_var}.kind = AttributeKind__${attr.kind};')
|
g.writeln('\t${node.val_var}.kind = AttributeKind__${attr.kind};')
|
||||||
g.stmts(node.stmts)
|
g.stmts(node.stmts)
|
||||||
g.writeln('}')
|
g.writeln('}')
|
||||||
|
11
vlib/v/tests/comptime/comptime_multiline_attr_test.v
Normal file
11
vlib/v/tests/comptime/comptime_multiline_attr_test.v
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module main
|
||||||
|
|
||||||
|
@[footer: 'Hello
|
||||||
|
World']
|
||||||
|
pub struct Config {}
|
||||||
|
|
||||||
|
fn test_main() {
|
||||||
|
$for a in Config.attributes {
|
||||||
|
assert a.arg == 'Hello\nWorld'
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user