fix: escaped newline immediately after a char, resolves #100 (#102)

This commit is contained in:
Andrew Hlynskyi 2021-09-22 07:30:05 +03:00 committed by GitHub
parent 7776f24dfa
commit 3243c9ab73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View File

@ -41,6 +41,41 @@ f=g \
(command_name (word))
(word)))
=============================
escaped newline immediately after a char
=============================
echo a \
b
echo a\
b
echo a\
b\
c
-----------------------------
(program
(command
(command_name
(word))
(word)
(word))
(command
(command_name
(word))
(word)
(word))
(command
(command_name
(word))
(word)
(word)
(word)))
=============================
Escaped whitespace
============================

1
src/scanner.cc vendored
View File

@ -172,6 +172,7 @@ struct Scanner {
if (!(
lexer->lookahead == 0 ||
iswspace(lexer->lookahead) ||
lexer->lookahead == '\\' ||
lexer->lookahead == '>' ||
lexer->lookahead == '<' ||
lexer->lookahead == ')' ||