Class: Ibex::Frontend::Token
- Inherits:
-
Struct
- Object
- Struct
- Ibex::Frontend::Token
- Defined in:
- lib/ibex/frontend/source_cursor.rb,
lib/ibex/frontend/source_cursor.rb,
sig/ibex/frontend/source_cursor.rbs,
sig/ibex/frontend/source_cursor.rbs
Overview
A grammar token and its source coordinate.
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#span ⇒ Object
Returns the value of attribute span.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def location @location end |
#span ⇒ Object
Returns the value of attribute span
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def span @span end |
#type ⇒ Object
Returns the value of attribute type
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def type @type end |
#value ⇒ Object
Returns the value of attribute value
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def value @value end |
Class Method Details
.new(type:, value:, location:, span:) ⇒ instance .new(arg0) ⇒ instance
35 36 |
# File 'sig/ibex/frontend/source_cursor.rbs', line 35
def self.new: (?type: Symbol, ?value: token_value, ?location: Location, ?span: SourceSpan?) -> instance
| ({ ?type: Symbol, ?value: token_value, ?location: Location, ?span: SourceSpan? }) -> instance
|
Instance Method Details
#to_h ⇒ Hash[Symbol, untyped]
36 37 38 |
# File 'lib/ibex/frontend/source_cursor.rb', line 36 def to_h { type: type, value: value, location: location.to_h } end |