class Prism::LexResult

This is a result specific to the ‘lex` and `lex_file` methods.

Attributes

value[R]

The list of tokens that were parsed from the source code.

Public Class Methods

new(value, comments, magic_comments, data_loc, errors, warnings, source) click to toggle source

Create a new lex result object with the given values.

Calls superclass method Prism::Result::new
# File lib/prism/parse_result.rb, line 598
def initialize(value, comments, magic_comments, data_loc, errors, warnings, source)
  @value = value
  super(comments, magic_comments, data_loc, errors, warnings, source)
end

Public Instance Methods

deconstruct_keys(keys) click to toggle source

Implement the hash pattern matching interface for LexResult.

Calls superclass method Prism::Result#deconstruct_keys
# File lib/prism/parse_result.rb, line 604
def deconstruct_keys(keys)
  super.merge!(value: value)
end