mirror of
https://github.com/vlang/v.git
synced 2025-09-24 04:48:28 -04:00
This commit is contained in:
parent
0e4078f27d
commit
9f666ad117
2
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_1.out
vendored
Normal file
2
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_1.out
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
start
|
||||
done
|
6
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_1.vv
vendored
Normal file
6
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_1.vv
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
println('start')
|
||||
b := 'Hello world!\u004azz\u005cXYZ'
|
||||
a := 'zzz\u005c${')}}));builtin__println(b);//'}QWE'
|
||||
_ := a
|
||||
_ := b
|
||||
println('done')
|
2
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_2.out
vendored
Normal file
2
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_2.out
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
start
|
||||
done
|
6
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_2.vv
vendored
Normal file
6
vlib/v/gen/c/testdata/string_escapes_and_quoting_issue_25304_2.vv
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
println('start')
|
||||
b := 'Hello world!'
|
||||
c := '\u005c${')}}));builtin__println(b);//'}'
|
||||
_ := b
|
||||
_ := c
|
||||
println('done')
|
@ -114,6 +114,10 @@ pub fn smart_quote(str string, raw bool) string {
|
||||
skip_next = true
|
||||
continue
|
||||
}
|
||||
// protect against '\u005c${...}'
|
||||
if next == 0 && current == backslash {
|
||||
continue
|
||||
}
|
||||
if !raw {
|
||||
if current == `$` {
|
||||
if last == backslash {
|
||||
|
Loading…
x
Reference in New Issue
Block a user