-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle very large hexadecimal number literals correctly
Very large decimal number literals, binary number literals and octal literals are lexed into an INFINITY token (instead of a NUMBER token) and compiled into `2e308`. That is is supposed to be the case for very large hexdecimal dumber literals as well, but previously wasn't. Before: $ node -p 'require("./").tokens(`0x${Array(256 + 1).join("f")}`)[0][0]' NUMBER After: $ node -p 'require("./").tokens(`0x${Array(256 + 1).join("f")}`)[0][0]' INFINITY This commit also cleans up `numberToken` in lexer.coffee a bit.
- Loading branch information
Showing
2 changed files
with
56 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters