-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser: fix wrong/missing locations of various AST nodes #11798
Merged
Merged
Changes from 35 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
9682141
Parser: fix end location of call name
FnControlOption 92b3b20
Parser: fix location of implicit tuple literal of multi-return
FnControlOption 41d371d
Parser: fix `else_location` of if statement without `else`
FnControlOption 0662d52
Check the text between an AST node's start and end locations
FnControlOption 4a1d081
Parser: fix location of multi-assign if expression
FnControlOption 1fe58da
Parser: fix end location of def with parenthesized parameters
FnControlOption 4e15582
Parser: fix location of global call
FnControlOption 0eadd4a
Parser: fix end location of `#[]=` call
FnControlOption a6b063b
Parser: fix end location of var with type declaration
FnControlOption 0f56113
Parser: fix end location of `#[]?` call
FnControlOption 930be1c
Parser: fix end location of array literal
FnControlOption 8e54f89
Parser: fix end location of multi-line call with block argument
FnControlOption c7b1e58
Parser: fix end location of call with receiver and block
FnControlOption 94f5252
Parser: add end location of array literal
FnControlOption bc085a9
Parser: fix end location of multi-line macro if
FnControlOption a3dd73a
Parser: add end location of `out` parameter
FnControlOption 84ff78d
Parser: add end location of nilable generic type
FnControlOption c5b8f8c
Parser: add end location of type with suffix
FnControlOption b6b1496
Parser: add end location of proc pointer
FnControlOption cd32b38
Parser: add end location of splat argument
FnControlOption 79b62f8
Parser: add end location of custom array literal
FnControlOption a154a90
Parser: add end location of negation suffix
FnControlOption 4792a84
Parser: add end location of attribute assignment
FnControlOption 2e94f4f
Parser: add end location of proc type
FnControlOption 7ee0dad
Comment out line to try and fix compiler error
FnControlOption 8863963
Revert "Comment out line to try and fix compiler error"
FnControlOption 9677086
Revert "Parser: add end location of array literal"
FnControlOption 68aaff6
Run `crystal tool format`
FnControlOption 0787432
Re-add end location of array literal
FnControlOption cab803f
Merge branch 'master' into ast
FnControlOption 4e30c38
Fix error
FnControlOption db5697e
Apply suggestions from code review
FnControlOption 502d63a
Merge branch 'master' into ast
FnControlOption 5ec08de
Fix off-by-one error
FnControlOption aed506a
Refactor consume_def_equals_sign_skip_space
FnControlOption a5ceac7
Merge branch 'master' into ast2
FnControlOption 19cf9b7
Add end location of `require`
FnControlOption 536df1f
Add location of `begin ... end`
FnControlOption 377aa74
Add end location of endless range literal
FnControlOption a75e424
Add end location of `.responds_to?`
FnControlOption 839c307
Add end location of `.nil?`
FnControlOption 8f76dd4
Add end location of uninitialized var
FnControlOption 981215f
Add end location of trailing `rescue`/`ensure`
FnControlOption d1407ac
Add end location of property assignment with splat
FnControlOption 89c1958
Don't set end_location in parse_atomic
FnControlOption 0df6a12
Don't change location of exception handler body
FnControlOption a958e3c
Add end location of local var
FnControlOption a92f6d5
Merge branch 'master' into ast
FnControlOption af8d754
Delete `focus: true`
FnControlOption e3e29e0
Add location of array literal element
FnControlOption 0032caf
Add location of trailing ensure
FnControlOption b511000
Add location of trailing rescue
FnControlOption 0da7e2e
Delete pseudo `Var#end_location`
FnControlOption ccb84e3
Add back TypeDeclaration location
FnControlOption c52c105
Merge branch 'master' into ast
asterite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of this expectation? I don't see how the source string comparison adds any relevant information to just the end location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s useful for checking if the start location is set correctly (so maybe I should move this to a separate test). However, I think the string comparison is easier to understand at a glance than line/column numbers (when the test fails), so perhaps we can delete the number comparisons altogether?