Class: Prism::ParseLexResult
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Result
|
|
Instance Chain:
self,
Result
|
|
Inherits: |
Prism::Result
|
Defined in: | lib/prism/parse_result.rb, prism/extension.c |
Overview
This is a result specific to the parse_lex and parse_lex_file methods.
Class Method Summary
-
.new(value, comments, magic_comments, data_loc, errors, warnings, source) ⇒ ParseLexResult
constructor
Create a new parse lex result object with the given values.
Result
- Inherited
.new | Create a new result object with the given values. |
Instance Attribute Summary
-
#value
readonly
A tuple of the syntax tree and the list of tokens that were parsed from the source code.
Result
- Inherited
#comments | The list of comments that were encountered during parsing. |
#data_loc | An optional location that represents the location of the __END__ marker and the rest of the content of the file. |
#errors | The list of errors that were generated during parsing. |
#failure? | Returns true if there were errors during parsing and false if there were not. |
#magic_comments | The list of magic comments that were encountered during parsing. |
#source | A Source instance that represents the source code that was parsed. |
#success? | Returns true if there were no errors during parsing and false if there were. |
#warnings | The list of warnings that were generated during parsing. |
Instance Method Summary
-
#deconstruct_keys(keys)
Implement the hash pattern matching interface for
ParseLexResult
.
Result
- Inherited
#code_units_cache | Create a code units cache for the given encoding. |
#deconstruct_keys | Implement the hash pattern matching interface for |
#encoding | Returns the encoding of the source code that was parsed. |
Constructor Details
.new(value, comments, magic_comments, data_loc, errors, warnings, source) ⇒ ParseLexResult
Create a new parse lex result object with the given values.
Instance Attribute Details
#value (readonly)
A tuple of the syntax tree and the list of tokens that were parsed from the source code.
# File 'lib/prism/parse_result.rb', line 784
attr_reader :value
Instance Method Details
#deconstruct_keys(keys)
Implement the hash pattern matching interface for ParseLexResult
.
# File 'lib/prism/parse_result.rb', line 793
def deconstruct_keys(keys) super.merge!(value: value) end