Ruby 3.1 features#7753
Conversation
3b5b4f5 to
a29d905
Compare
5809718 to
e3e88bd
Compare
nickrolfe
left a comment
There was a problem hiding this comment.
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.
hvitved
left a comment
There was a problem hiding this comment.
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.
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.
I think this can remain final.
| } | ||
| } | ||
|
|
||
| private module AnonymousBlockParameterSynth { |
There was a problem hiding this comment.
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