class Ruby::Prism::Token
This represents a token from the Ruby source.
Attributes
The type of token that this token is.
A byteslice of the source that this token represents.
Public Class Methods
Create a new token object with the given type, value, and location.
: (Source source, Symbol type, String value, Location | Integer location, Integer state) -> void
# File lib/ruby/prism/parse_result.rb, line 1114 def initialize(source, type, value, location, state) @source = source @type = type @value = value @location = location @state = state end
Public Instance Methods
Returns true if the given other token is equal to this token.
: (untyped other) -> bool
# File lib/ruby/prism/parse_result.rb, line 1158 def ==(other) Token === other && other.type == type && other.value == value end
Freeze this object and the objects it contains.
: () -> void
# File lib/ruby/prism/parse_result.rb, line 1175 def deep_freeze value.freeze location.freeze freeze end