Skip to content

Separate line and block comments into distinct node types#271

Merged
aspeddro merged 3 commits intorescript-lang:mainfrom
aspeddro:aspeddro/block-comment
Apr 24, 2026
Merged

Separate line and block comments into distinct node types#271
aspeddro merged 3 commits intorescript-lang:mainfrom
aspeddro:aspeddro/block-comment

Conversation

@aspeddro
Copy link
Copy Markdown
Collaborator

@aspeddro aspeddro commented Apr 23, 2026

Replace the single comment external token (and the _newline_and_comment
hack) with two distinct node types: line_comment (a grammar-level token
matching //...) and block_comment (handled by the external scanner).

This makes comment node types more precise and removes the workaround of aliasing _newline_and_comment as comment in statement delimiters. Update all query files and corpus tests to reference the new node names.

Close #135

Co-authored-by: Claude Opus 4.7 noreply@anthropic.com

🤖 Generated with Claude Code

Replace the single `comment` external token (and the
`_newline_and_comment`
hack) with two distinct node types: `line_comment` (a grammar-level
token
matching `//...`) and `block_comment` (handled by the external scanner).

This makes comment node types more precise and removes the workaround of
aliasing `_newline_and_comment` as `comment` in statement delimiters.
Update all query files and corpus tests to reference the new node names.
@aspeddro aspeddro requested a review from nojaf April 23, 2026 14:16
@aspeddro aspeddro requested review from cristianoc and nkrkv April 23, 2026 14:21
@aspeddro aspeddro merged commit 6254b2a into rescript-lang:main Apr 24, 2026
1 check passed
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.

All comment nodes are not being found

3 participants