Fix string literals not parsing correctly
This commit is contained in:
parent
2adb962b53
commit
1e9f3e1ab5
1 changed files with 2 additions and 1 deletions
3
query.js
3
query.js
|
@ -175,7 +175,7 @@ const compileQueryExpr = (function() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// parse a string literal
|
// parse a string literal
|
||||||
if ((m = /^"[^"]+"/.exec(exprStr.substring(col))) !== null) {
|
if ((m = /^"([^"]+)"/.exec(exprStr.substring(col))) !== null) {
|
||||||
tokens.push({ type: 'str', value: m[1] });
|
tokens.push({ type: 'str', value: m[1] });
|
||||||
col += m[0].length;
|
col += m[0].length;
|
||||||
continue;
|
continue;
|
||||||
|
@ -377,6 +377,7 @@ const compileQueryExpr = (function() {
|
||||||
case 'str': {
|
case 'str': {
|
||||||
const lit = tokens.here.value;
|
const lit = tokens.here.value;
|
||||||
tokens.advance();
|
tokens.advance();
|
||||||
|
console.log(lit);
|
||||||
return (i, ie) => lit;
|
return (i, ie) => lit;
|
||||||
}
|
}
|
||||||
case 'id':
|
case 'id':
|
||||||
|
|
Loading…
Add table
Reference in a new issue