mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser/cgen: fix order of escape replacements
This commit is contained in:
@ -2595,8 +2595,8 @@ fn (p mut Parser) char_expr() {
|
||||
fn format_str(_str string) string {
|
||||
// TODO don't call replace 3 times for every string, do this in scanner.v
|
||||
return _str.replace_each(['"', '\\"',
|
||||
'\n', '\\n',
|
||||
'\r\n', '\\n'])
|
||||
'\r\n', '\\n',
|
||||
'\n', '\\n'])
|
||||
}
|
||||
|
||||
// m := map[string]int{}
|
||||
|
Reference in New Issue
Block a user