Repository navigation
[test] Add lexer cases for comments and strings - #2355
Merged
Merged
Conversation
A line comment can hold any character except a line break, so a NUL byte is valid. Add cases in plain text and inside an annotation. Each module exports a function after the comment and invokes it, so the test fails if the lexer skips the rest of the input.
The source text must be valid UTF-8, also inside comments. Add cases for a line comment, a block comment and a nested block comment.
A block comment must end with ";)". Add cases for an unclosed comment at the start of the input, after a field, and inside an annotation.
A string literal cannot hold a raw character below U+20. Add a case with U+01 in a data string.
ibmibmibm
marked this pull request as ready for review
November 25, 2026 23:25
rossberg
approved these changes
Nov 26, 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
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.
Adds cases for a NUL byte in a line comment, invalid UTF-8 in comments, unclosed block comments, and a control character in a string. The NUL cases invoke a function after the comment, so a lexer that skips the rest of the input fails.
comments.wastholds raw NUL bytes, so usegit diff --text.