FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix JavaScript number tokenization by nightcityblade · Pull Request #1314 · python-babel/babel · GitHub

Fix JavaScript number tokenization - #1314

Open
nightcityblade wants to merge 1 commit into
python-babel:masterfrom
nightcityblade:fix/issue-789
Open

Fix JavaScript number tokenization#1314
nightcityblade wants to merge 1 commit into
python-babel:masterfrom
nightcityblade:fix/issue-789

Conversation

Copy link
Copy Markdown

Fixes #789

Prevent JavaScript identifier rules from matching tokens that start with a digit, allowing decimal, fractional, and exponent literals to reach the number rule. The number rule now checks hexadecimal literals before the shorter 0 alternative so their full token is preserved.

Adds focused regression coverage for all four supported number forms.

Tests:

  • python -m pytest -q — 7736 passed, 7 skipped, 2 xfailed
  • pre-commit run --files babel/messages/jslexer.py tests/messages/test_jslexer.py
  • python -m compileall -q babel/messages/jslexer.py tests/messages/test_jslexer.py

akx added the area/javascript JavaScript extractor label Aug 14, 2026
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/javascript JavaScript extractor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor bug in JavaScript lexer; failing to recognize numbers

2 participants


Back | FazBrowse Home | New Git URL