Class: Prism::ParseLexResult
- Defined in:
- lib/prism/parse_result.rb,
ext/prism/extension.c
Overview
This is a result specific to the ‘parse_lex` and `parse_lex_file` methods.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
A tuple of the syntax tree and the list of tokens that were parsed from the source code.
Attributes inherited from Result
#comments, #data_loc, #errors, #magic_comments, #source, #warnings
Instance Method Summary collapse
-
#deconstruct_keys(keys) ⇒ Object
Implement the hash pattern matching interface for ParseLexResult.
-
#initialize(value, comments, magic_comments, data_loc, errors, warnings, source) ⇒ ParseLexResult
constructor
Create a new parse lex result object with the given values.
Methods inherited from Result
#code_units_cache, #encoding, #failure?, #success?
Constructor Details
#initialize(value, comments, magic_comments, data_loc, errors, warnings, source) ⇒ ParseLexResult
Create a new parse lex result object with the given values.
804 805 806 807 |
# File 'lib/prism/parse_result.rb', line 804 def initialize(value, comments, magic_comments, data_loc, errors, warnings, source) @value = value super(comments, magic_comments, data_loc, errors, warnings, source) end |
Instance Attribute Details
#value ⇒ Object (readonly)
A tuple of the syntax tree and the list of tokens that were parsed from the source code.
801 802 803 |
# File 'lib/prism/parse_result.rb', line 801 def value @value end |
Instance Method Details
#deconstruct_keys(keys) ⇒ Object
Implement the hash pattern matching interface for ParseLexResult.
810 811 812 |
# File 'lib/prism/parse_result.rb', line 810 def deconstruct_keys(keys) super.merge!(value: value) end |