Skip to content

Commit

Permalink
fix newline rune
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Aug 9, 2023
1 parent 3043b5c commit aae5b61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/c2v.v
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,11 @@ fn (mut c C2V) expr(_node &Node) string {
} else {
rune(node.value_number).str()
}
c.gen('`' + val + '`')
if val == '\n' {
c.gen('`\\n`')
} else {
c.gen('`' + val + '`')
}
}
// 1e80
else if node.kindof(.floating_literal) {
Expand Down

0 comments on commit aae5b61

Please sign in to comment.