Repository navigation
a comment behind the arrow of a lambda ends the statement - #154
Merged
Merged
Conversation
Problem: A comment behind the arrow of a lambda ends the statement.
Solution: Read whether a line ends with the arrow from its tokens, past
a comment (Galvarcus).
Vim9 carries a line that ends with `=>` on to the body of the lambda on
the next line (#94). The lexer read that end from the raw text, so a
comment behind the arrow hid it. The statement then ended at the arrow,
and the body became a statement of its own, where the parameters of the
lambda were names.
code_ends now reads the last tokens of a line other than a comment, for
the arrow alone and for the arrow and the brace that open a block lambda
(#147), which it replaces.
The four corpora and the survey report the same as before.
fixes: #151
related: #94
related: #147
related: #140
Assisted-by: Claude Opus 5
Signed-off-by: Galvarcus <117151435+Galvarcus@users.noreply.github.com>
7 tasks done
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.
Vim9 carries a line that ends with
=>on to the body of the lambda on the next line (#94). The lexer read that end from the raw text, so a comment behind the arrow hid it. The statement then ended at the arrow, and the body became a statement of its own, where the parameters of the lambda were names.code_endsnow reads the last tokens of a line other than a comment, for the arrow alone and for the arrow and the brace that open a block lambda (#147), which it replaces.fixes: #151
AI assistance
Checklist
tools/checkprintsevery check passedSigned-off-by:trailer is present, which theprepare-commit-msghook adds. A fresh checkout has no hooks,so install them again before the first commit
Tests
a_lambda_parameter_read_after_a_comment_behind_the_arrow_is_no_referenceintests/vim9_syntax.rsfails onlnumwithout the change.What the analyzer reports
The four corpora and the survey report the same as before.
Documentation
Anything reviewers should know
The cloud review of
Developmentagainstmainfound this fault. A dot that ends a line of a lambda block still reaches into the next line, which this change does not touch; it is #153.