123456789_123456789_123456789_123456789_123456789_

Class: Prism::LexCompat::IdentToken

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Token, SimpleDelegator
Instance Chain:
self, Token, SimpleDelegator
Inherits: Prism::LexCompat::Token
Defined in: lib/prism/lex_compat.rb

Overview

Ident tokens for the most part are exactly the same, except sometimes we know an ident is a local when ripper doesn’t (when they are introduced through named captures in regular expressions). In that case we don’t compare the state.

Instance Method Summary

Token - Inherited

#event

The type of the token.

#location

The location of the token in the source.

#state

The state of the lexer when this token was produced.

#value

The slice of the source that this token represents.

Instance Method Details

#==(other)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/prism/lex_compat.rb', line 229

def ==(other) # :nodoc:
  (self[0...-1] == other[0...-1]) && (
    (other[3] == Ripper::EXPR_LABEL | Ripper::EXPR_END) ||
    (other[3] & Ripper::EXPR_ARG_ANY != 0)
  )
end