class YARP::Token
This represents a token from the Ruby source.
Attributes
location[R]
type[R]
value[R]
Public Class Methods
new(type, value, location)
click to toggle source
# File yarp.rb, line 257 def initialize(type, value, location) @type = type @value = value @location = location end
Public Instance Methods
==(other)
click to toggle source
# File yarp.rb, line 281 def ==(other) other.is_a?(Token) && other.type == type && other.value == value end
deconstruct_keys(keys)
click to toggle source
# File yarp.rb, line 263 def deconstruct_keys(keys) { type: type, value: value, location: location } end
pretty_print(q)
click to toggle source
# File yarp.rb, line 267 def pretty_print(q) q.group do q.text(type.to_s) self.location.pretty_print(q) q.text("(") q.nest(2) do q.breakable("") q.pp(value) end q.breakable("") q.text(")") end end