Fix escape sequence parsing
This commit is contained in:
parent
a854dd0618
commit
dbffe4b7c4
11
asv.go
11
asv.go
@ -156,12 +156,17 @@ func (this *Decoder) ReadUnit () (unit Unit, next rune, err error) {
|
||||
char, _, err := this.reader.ReadRune()
|
||||
if err != nil { return Unit(str.String()), 0, err }
|
||||
|
||||
if esc {
|
||||
switch {
|
||||
case esc:
|
||||
esc = false
|
||||
} else if IsSeparator(char) {
|
||||
str.WriteRune(char)
|
||||
case char == Escape:
|
||||
esc = true
|
||||
case IsSeparator(char):
|
||||
return Unit(str.String()), char, nil
|
||||
default:
|
||||
str.WriteRune(char)
|
||||
}
|
||||
str.WriteRune(char)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user