Repository navigation
fix(parser): handle nested Nim comments and add regression coverage - #44
Merged
Aaqibhafeezkhan merged 1 commit intoOct 31, 2026
Merged
Conversation
Aaqibhafeezkhan
approved these changes
Oct 31, 2026
Aaqibhafeezkhan
left a comment
Owner
There was a problem hiding this comment.
Reviewed against issue #39. The change adds representative nested-comment coverage for all nine supported nesting profiles, checks mixed line-ending preservation and unterminated outer blocks, protects delimiters inside strings, and verifies that non-nesting profiles retain their existing behavior. The Nim fix is narrowly scoped to recognizing #[ as a nesting opener, matching Nim's nested block-comment syntax. No correctness or scope issues found.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #39. Add 42 regression cases for nested block comments, including mixed line endings, unterminated outer blocks, protected strings and ordinary comments in other profiles.
The tests cover Rust, Swift, Kotlin, Scala, Dart, Haskell, Julia, Nim and D. Three new cases expose a missing nesting delimiter for Nim. Include
#[in the existing nesting check so an inner]#cannot end the outer comment early.For example:
Expected output:
let a = 1 ; echo a. Before this fix the scanner returnslet a = 1 outer ], losing the remaining code. Nim's multiline comment specification permits nesting.Changes
test/nested-comments.test.jswith behavior-focused cases.Validation
npm test: 64 passed.The last two items are inapplicable to this scanner regression fix. UI behavior, dependencies and existing handling of other language profiles are unchanged.