Class: RPrec::Token
- Inherits:
-
Object
- Object
- RPrec::Token
- Defined in:
- lib/rprec/token.rb
Overview
Token
is a token.
Instance Attribute Summary collapse
- #loc ⇒ Range? readonly
- #type ⇒ String readonly
- #value ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(type, value = nil, loc: nil) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(type, value = nil, loc: nil) ⇒ Token
Returns a new instance of Token.
9 10 11 12 13 |
# File 'lib/rprec/token.rb', line 9 def initialize(type, value = nil, loc: nil) @type = type @value = value @loc = loc end |
Instance Attribute Details
#loc ⇒ Range? (readonly)
22 23 24 |
# File 'lib/rprec/token.rb', line 22 def loc @loc end |
#type ⇒ String (readonly)
18 19 20 |
# File 'lib/rprec/token.rb', line 18 def type @type end |
#value ⇒ Object (readonly)
20 21 22 |
# File 'lib/rprec/token.rb', line 20 def value @value end |