-
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
Ruby 3.1 features #7753
Ruby 3.1 features #7753
Conversation
3b5b4f5
to
a29d905
Compare
5809718
to
e3e88bd
Compare
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.
Looks great overall - just a couple of questions. Also, I didn't feel very confident reviewing the changes to Synthesis.qll
, so it might be good to take a second pair of eyes on those.
ruby/downgrades/24d81950f3ab7e67e14553e1a5111a04e8ae8445/upgrade.properties
Show resolved
Hide resolved
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.
Looks great! Remember to do a DCA run.
|
||
/** Gets the variable access corresponding to this variable reference pattern. */ | ||
LocalVariableReadAccess getVariableAccess() { toGenerated(result) = g.getName() } | ||
/** Gets the value this reference pattern matches against. */ |
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.
Should we rename to getExpr
?
Also, I think we should add an example, something like For example `2 * x` in `^(2 * x)`
|
||
final override string toString() { result = "^..." } | ||
|
||
final override AstNode getAChild(string pred) { | ||
override AstNode getAChild(string pred) { |
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.
I think this can remain final
.
} | ||
} | ||
|
||
private module AnonymousBlockParameterSynth { |
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.
Add ql doc, something like
/**
* ```rb
* def foo(&)
* bar(&)
* end
* ```
* desugars to,
* ```rb
* def foo(&__synth_0)
* bar(&__synth_0)
* end
* ```
*/
@hvitved Are you happy with this PR and the DCA results? |
I had a quick look at the DCA results and it looks like there are no alert changes and the analysis times didn't change significantly. |
This pull request updates the tree-sitter grammar with the following Ruby 3.1 features
See also: tree-sitter/tree-sitter-ruby#201