1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: revert changes to format_str

This commit is contained in:
Joe Conigliaro 2020-03-13 00:32:26 +11:00
parent 597811093c
commit 07921194f2

View File

@ -2594,9 +2594,10 @@ 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(['"', '\\"',
'\r\n', '\\n',
'\n', '\\n'])
mut str := _str.replace('"', '\\"')
str = str.replace('\r\n', '\\n')
str = str.replace('\n', '\\n')
return str
}
// m := map[string]int{}