We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 81fa7c3 + b2c438f commit e0bfd09Copy full SHA for e0bfd09
parser.go
@@ -32,18 +32,19 @@ func nextValue(data []byte, skipComma bool) int {
32
// Tries to find the end of string
33
// Support if string contains escaped quote symbols.
34
func stringEnd(data []byte) int {
35
- escaped := false
36
for i, c := range data {
37
- switch c {
38
- case '\\':
39
- escaped = !escaped
40
- case '"':
41
- if !escaped {
42
- return i + 1
+ if c == '"' {
+ j := i - 1
+ for {
+ if j < 0 || data[j] != '\\' {
+ return i + 1 // even number of backslashes
+ }
+ j--
43
44
+ break // odd number of backslashes
45
46
47
}
- escaped = false
- default:
48
49
50
0 commit comments