add whitespace escaping for backslash

This commit is contained in:
Gokcehan committed 2016-11-22 22:12:47 +03:00
1 parent 87434d3fe6
commit bfd33f8437
2 files changed
+36 -2

No files matched your search

+12 -2
View File
@@ -236,13 +236,23 @@ scan:
s.cmd = true
s.next()
default:
beg := s.off
var buf []byte
for !s.eof && !isSpace(s.chr) && s.chr != ';' && s.chr != '#' {
if s.chr == '\\' {
s.next()
if isSpace(s.chr) {
buf = append(buf, s.chr)
s.next()
} else {
s.next()
}
}
buf = append(buf, s.chr)
s.next()
}
s.typ = TokenIdent
s.tok = string(s.buf[beg:s.off])
s.tok = string(buf)
s.sem = true
if s.tok == "push" {