| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
... as per ko1's preference. He is preparing to extend this feature to
ISeq for his new debugger. He prefers "keep" to "save" for this wording.
This API is internal and not included in any released version, so I
change it in advance.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
RubyVM::AbstractSyntaxTree is a module actually, but the document says "class".
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
```
% 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.
|