Class: RemLint::Token
- Inherits:
-
Struct
- Object
- Struct
- RemLint::Token
- Defined in:
- lib/remlint/expr_lexer.rb
Overview
One lexeme of a command's body, with where it sat.
offset is a character offset into the logical line's text, which
LogicalLine#position_at turns into a file line and column. Tokens carry
the offset rather than a line number because a continued command's tokens
are spread over several lines and only the offset survives the join.
Instance Attribute Summary collapse
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#offset ⇒ Object
Returns the value of attribute offset
12 13 14 |
# File 'lib/remlint/expr_lexer.rb', line 12 def offset @offset end |
#type ⇒ Object
Returns the value of attribute type
12 13 14 |
# File 'lib/remlint/expr_lexer.rb', line 12 def type @type end |
#value ⇒ Object
Returns the value of attribute value
12 13 14 |
# File 'lib/remlint/expr_lexer.rb', line 12 def value @value end |
Instance Method Details
#end_offset ⇒ Object
22 23 24 |
# File 'lib/remlint/expr_lexer.rb', line 22 def end_offset offset + length end |
#length ⇒ Object
18 19 20 |
# File 'lib/remlint/expr_lexer.rb', line 18 def length value.length end |