cgen: do not use L'x' for ASCII values (enable compilation with simpler C compilers)

pull/10107/head
Delyan Angelov 2021-05-15 10:36:26 +03:00
parent 9fa805cbbf
commit 1305ca662f
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 5 additions and 1 deletions

View File

@ -3100,7 +3100,11 @@ fn (mut g Gen) expr(node ast.Expr) {
if node.val == r'\`' { if node.val == r'\`' {
g.write("'`'") g.write("'`'")
} else { } else {
g.write("L'$node.val'") if utf8_str_len(node.val) < node.val.len {
g.write("L'$node.val'")
} else {
g.write("'$node.val'")
}
} }
} }
ast.DumpExpr { ast.DumpExpr {