parent
488bf9f6b6
commit
6982ffe4cf
@ -101,6 +101,12 @@ var gEvalTests = []struct {
|
|||||||
[]expr{&callExpr{"echo", []string{"hello\nworld"}, 1}},
|
[]expr{&callExpr{"echo", []string{"hello\nworld"}, 1}},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
`echo hello\\world`,
|
||||||
|
[]string{"echo", `hello\world`, "\n"},
|
||||||
|
[]expr{&callExpr{"echo", []string{`hello\world`}, 1}},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
`echo hello\zworld`,
|
`echo hello\zworld`,
|
||||||
[]string{"echo", "helloworld", "\n"},
|
[]string{"echo", "helloworld", "\n"},
|
||||||
|
2
scan.go
2
scan.go
@ -293,7 +293,7 @@ scan:
|
|||||||
for !s.eof && !isSpace(s.chr) && s.chr != ';' && s.chr != '#' {
|
for !s.eof && !isSpace(s.chr) && s.chr != ';' && s.chr != '#' {
|
||||||
if s.chr == '\\' {
|
if s.chr == '\\' {
|
||||||
s.next()
|
s.next()
|
||||||
if isSpace(s.chr) {
|
if isSpace(s.chr) || s.chr == '\\' {
|
||||||
buf = append(buf, s.chr)
|
buf = append(buf, s.chr)
|
||||||
s.next()
|
s.next()
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user