fix inQuotes + tests

This commit is contained in:
zadam
2020-07-19 23:23:48 +02:00
parent 35469f6f2d
commit 4e5ddaf7d1
2 changed files with 19 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ function lexer(str) {
const rec = {
token: currentWord,
inQuotes: quotes
inQuotes: !!quotes
};
if (fulltextEnded) {
@@ -71,9 +71,9 @@ function lexer(str) {
}
}
else if (quotes === chr) {
quotes = false;
finishWord();
quotes = false;
}
else {
// it's a quote but within other kind of quotes so it's valid as a literal character