Skip to content

Commit

Permalink
fix(parser): fix crash on improper negative BigIntLiterals, e.g. "42-"
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjson committed Nov 15, 2019
1 parent d7b64a2 commit 5547ee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/auth/templates/language/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const authenticationScriptParser = P.createLanguage({
(__, literal) => literal
).node('HexLiteral'),
bigint: _ =>
P.regexp(/[\-0-9]+/)
P.regexp(/-?[0-9]+/)
.desc('an integer literal')
.map(BigInt)
.node('BigIntLiteral')
Expand Down

0 comments on commit 5547ee7

Please sign in to comment.