Skip to content

Fix symbol parsing#242

Merged
comnik merged 4 commits intomainfrom
ncg-parser-fixes
Apr 6, 2026
Merged

Fix symbol parsing#242
comnik merged 4 commits intomainfrom
ncg-parser-fixes

Conversation

@comnik
Copy link
Copy Markdown
Collaborator

@comnik comnik commented Apr 3, 2026

Fix extracted from one of Nate's old PRs

BUG: SYMBOL lexer regex has incorrect character class

  Location: grammar.y:46 (propagates to all generated SDKs)

  Problem: The regex [a-zA-Z0-9_./#-] is incorrect. Inside a character class, - between / and ] is ambiguous — in some regex engines it's interpreted as a range
from
   # (0x23) to - (0x2D), which unintentionally includes characters like $, %, &, ', (, ), *, +, ,.

  Fix: Move the - to the end of the character class so it's treated as a literal hyphen:

  [a-zA-Z0-9_.#/-]*

@comnik comnik self-assigned this Apr 3, 2026
@comnik comnik requested a review from minsungc April 3, 2026 13:27
@comnik comnik changed the title Two parser fixes Fix symbol parsing Apr 3, 2026
The revert of the endianness commit also reverted the binary and
pretty_debug snapshot changes that were part of the SYMBOL fix.
Regenerate them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@minsungc minsungc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@comnik comnik merged commit 84fe7a1 into main Apr 6, 2026
5 checks passed
@comnik comnik deleted the ncg-parser-fixes branch April 6, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants