Age | Commit message (Collapse) | Author |
|
Now ISeq#to_a includes the node_id list for each bytecode instruction.
I want a way to retrieve the AST::Node instance corresponding to an
instruction for a research purpose including TypeProf-based LSP server.
|
|
This option makes the parser keep the original source as an array of
the original code lines. This feature exploits the mechanism of
`SCRIPT_LINES__` but records only the specified code that is passed to
RubyVM::AST.of or .parse, instead of recording all parsed program texts.
Notes:
Merged: https://github.com/ruby/ruby/pull/4581
|
|
|
|
RubyVM::AbstractSyntaxTree is a module actually, but the document says "class".
Notes:
Merged: https://github.com/ruby/ruby/pull/3251
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3165
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3165
|
|
|
|
```
% docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'root = RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
p [root, root.type]
call = root.children[2]
p [call, call.type]
'
ruby-2.6.0 [#<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>, :SCOPE]
[#<RubyVM::AbstractSyntaxTree::Node:LASGN@1:0-1:9>, :LASGN]
...
ruby-2.7.0 [#<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:9>, :SCOPE]
[#<RubyVM::AbstractSyntaxTree::Node:LASGN@1:0-1:9>, :LASGN]
```
|
|
|
|
* See [Feature #14844].
|
|
|
|
Define RubyVM::AbstractSyntaxTree in ast.rb
with __builtin functions.
Notes:
Merged: https://github.com/ruby/ruby/pull/2655
|