class Prism::Token
This represents a token from the Ruby source.
This represents a token from the Ruby source.
Attributes
Public Class Methods
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/parse_result.rb, line 1116 def initialize(source, type, value, location, state) @source = source @type = type @value = value @location = location @state = state end
Public Instance Methods
(untyped other) → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/parse_result.rb, line 1160 def ==(other) Token === other && other.type == type && other.value == value end
Returns true if the given other token is equal to this token.
Returns true if the given other token is equal to this token.
: (untyped other) -> bool
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/parse_result.rbs, line 839
def []: (Integer index) -> Token
() → Integer
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/parse_result.rbs, line 836
def _ripper_state: () -> Integer
For internal use only. : () -> Integer
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/parse_result.rbs, line 807
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
() → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/parse_result.rb, line 1177 def deep_freeze value.freeze location.freeze freeze end
Freeze this object and the objects it contains.
Freeze this object and the objects it contains.
: () -> void
() → Token
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/parse_result.rbs, line 842
def first: () -> Token
: () -> Token
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/parse_result.rbs, line 827
def inspect: () -> String
Returns a string representation of this token.
: () -> String
() → Location
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/parse_result.rb, line 1134 def location location = @location return location if location.is_a?(Location) @location = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
(PP q) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/parse_result.rbs, line 817
def pretty_print: (PP q) -> void