unget the unary token if got no term to finalize
This commit is contained in:
parent
acbb69e5ad
commit
9111ebcd2b
|
@ -4840,6 +4840,7 @@ self.parserlib = (() => {
|
||||||
const unary = stream.match([Tokens.MINUS, Tokens.PLUS]) && stream._token;
|
const unary = stream.match([Tokens.MINUS, Tokens.PLUS]) && stream._token;
|
||||||
|
|
||||||
const finalize = (token, value) => {
|
const finalize = (token, value) => {
|
||||||
|
if (!token && unary) stream.unget();
|
||||||
if (!token) return null;
|
if (!token) return null;
|
||||||
if (token instanceof SyntaxUnit) return token;
|
if (token instanceof SyntaxUnit) return token;
|
||||||
if (unary) {
|
if (unary) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user