Class: Prism::LexResult
- Defined in:
- lib/prism/parse_result.rb,
ext/prism/extension.c
Overview
This is a result specific to the ‘lex` and `lex_file` methods.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
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 LexResult.
-
#initialize(value, comments, magic_comments, data_loc, errors, warnings, source) ⇒ LexResult
constructor
Create a new 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) ⇒ LexResult
Create a new lex result object with the given values.
769 770 771 772 |
# File 'lib/prism/parse_result.rb', line 769 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)
The list of tokens that were parsed from the source code.
766 767 768 |
# File 'lib/prism/parse_result.rb', line 766 def value @value end |
Instance Method Details
#deconstruct_keys(keys) ⇒ Object
Implement the hash pattern matching interface for LexResult.
775 776 777 |
# File 'lib/prism/parse_result.rb', line 775 def deconstruct_keys(keys) super.merge!(value: value) end |