diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-08-25 16:53:29 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-08-25 18:23:05 +0900 |
commit | 6aa16f9ec14a296f549dc955774ad2293d1c54d6 (patch) | |
tree | 39498c84bbdf2d7edd499d6e60642c1ca34cb908 /ast.rb | |
parent | d9cba2fc74addc3e0a6da0fe230fd333fb1c31ac (diff) |
Move SCRIPT_LINES__ away from parse.y
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8289
Diffstat (limited to 'ast.rb')
-rw-r--r-- | ast.rb | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -20,7 +20,7 @@ module RubyVM::AbstractSyntaxTree # call-seq: - # RubyVM::AbstractSyntaxTree.parse(string, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node + # RubyVM::AbstractSyntaxTree.parse(string, keep_script_lines: RubyVM.keep_script_lines, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node # # Parses the given _string_ into an abstract syntax tree, # returning the root node of that tree. @@ -55,12 +55,12 @@ module RubyVM::AbstractSyntaxTree # # Note that parsing continues even after the errored expression. # - def self.parse string, keep_script_lines: false, error_tolerant: false, keep_tokens: false + def self.parse string, keep_script_lines: RubyVM.keep_script_lines, error_tolerant: false, keep_tokens: false Primitive.ast_s_parse string, keep_script_lines, error_tolerant, keep_tokens end # call-seq: - # RubyVM::AbstractSyntaxTree.parse_file(pathname, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node + # RubyVM::AbstractSyntaxTree.parse_file(pathname, keep_script_lines: RubyVM.keep_script_lines, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node # # Reads the file from _pathname_, then parses it like ::parse, # returning the root node of the abstract syntax tree. @@ -72,13 +72,13 @@ module RubyVM::AbstractSyntaxTree # # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-31:3> # # See ::parse for explanation of keyword argument meaning and usage. - def self.parse_file pathname, keep_script_lines: false, error_tolerant: false, keep_tokens: false + def self.parse_file pathname, keep_script_lines: RubyVM.keep_script_lines, error_tolerant: false, keep_tokens: false Primitive.ast_s_parse_file pathname, keep_script_lines, error_tolerant, keep_tokens end # call-seq: - # RubyVM::AbstractSyntaxTree.of(proc, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node - # RubyVM::AbstractSyntaxTree.of(method, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node + # RubyVM::AbstractSyntaxTree.of(proc, keep_script_lines: RubyVM.keep_script_lines, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node + # RubyVM::AbstractSyntaxTree.of(method, keep_script_lines: RubyVM.keep_script_lines, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node # # Returns AST nodes of the given _proc_ or _method_. # @@ -93,7 +93,7 @@ module RubyVM::AbstractSyntaxTree # # => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-3:3> # # See ::parse for explanation of keyword argument meaning and usage. - def self.of body, keep_script_lines: false, error_tolerant: false, keep_tokens: false + def self.of body, keep_script_lines: RubyVM.keep_script_lines, error_tolerant: false, keep_tokens: false Primitive.ast_s_of body, keep_script_lines, error_tolerant, keep_tokens end |