Skip to content

Commit 3d2ffe0

Browse files
committed
Merge branch 'master'
2 parents 82ad37e + 0364bb7 commit 3d2ffe0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/parser.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,13 @@ exports.parse = function (input) {
782782
}
783783
tok = { type: "num", value: -num.value }
784784
}
785+
if (tok.type == "op" && tok.value == "-") {
786+
let num = input.next()
787+
if(num.type != "num") {
788+
unexpected()
789+
}
790+
tok = { type: "num", value: -num.value }
791+
}
785792
if (tok.type == "num" || tok.type == "str") return tok;
786793

787794
unexpected();

0 commit comments

Comments
 (0)