summaryrefslogtreecommitdiff
path: root/ast.rb
Commit message (Collapse)AuthorAgeFilesLines
* ast.c: Rename "save_script_lines" to "keep_script_lines"Yusuke Endoh2021-08-201-6/+6
| | | | | | | ... 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.
* Experimentally expose RubyVM::AST::Node#node_idYusuke Endoh2021-06-211-0/+11
| | | | | | 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.
* ast.rb: RubyVM::AST.parse and .of accepts `save_script_lines: true`Yusuke Endoh2021-06-181-6/+42
| | | | | | | 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.
* ast.rb: reduce nestingNobuyoshi Nakada2021-06-061-117/+114
|
* Fix RubyVM::AbstractSyntaxTree documentMasataka Pocke Kuwabara2020-06-241-2/+2
| | | | RubyVM::AbstractSyntaxTree is a module actually, but the document says "class".
* [Feature #16254] Use `Primitive.func` styleNobuyoshi Nakada2020-06-191-10/+10
|
* [Feature #16254] Use `__builtin.func` styleNobuyoshi Nakada2020-06-191-10/+10
|
* Fix variable name and add more example [ci skip]Kazuhiro NISHIYAMA2020-01-031-2/+4
|
* Fix example of node.type [ci skip]Kazuhiro NISHIYAMA2020-01-031-1/+1
| | | | | | | | | | | | | | | ``` % 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] ```
* Improve highlighting in RubyVM::AbstractSyntaxTree docs when using `ri`Benoit Daloze2019-12-141-1/+1
|
* Clarify in the documentation that RubyVM::AbstractSyntaxTree is not stable APIBenoit Daloze2019-12-141-0/+10
| | | | * See [Feature #14844].
* fix line break code (fix to LF)Koichi Sasada2019-11-081-134/+134
|
* use builtin for RubyVM::AbstractSyntaxTree.Koichi Sasada2019-11-081-0/+134
Define RubyVM::AbstractSyntaxTree in ast.rb with __builtin functions.