Class: Liquidscript::Scanner::Liquidscript
- Includes:
- Base::DSL
- Defined in:
- lib/liquidscript/scanner/liquidscript.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Attributes inherited from Base
Instance Method Summary collapse
- #column ⇒ Object
-
#initialize ⇒ Liquidscript
constructor
A new instance of Liquidscript.
- #line ⇒ Object
- #line! ⇒ Object
Methods included from Base::DSL
Methods inherited from Base
contexts, #contexts, #default_context, #each, #emit, #inspect, #scan
Methods included from Base::Lexer
#error, #lex, #perform_with_context
Constructor Details
#initialize ⇒ Liquidscript
Returns a new instance of Liquidscript.
193 194 195 196 197 198 |
# File 'lib/liquidscript/scanner/liquidscript.rb', line 193 def initialize(*) @line = 1 @cstart = 0 @lexes = [] super end |
Instance Attribute Details
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
7 8 9 |
# File 'lib/liquidscript/scanner/liquidscript.rb', line 7 def tokens @tokens end |
Instance Method Details
#column ⇒ Object
214 215 216 |
# File 'lib/liquidscript/scanner/liquidscript.rb', line 214 def column @scanner.pos - @cstart end |
#line ⇒ Object
210 211 212 |
# File 'lib/liquidscript/scanner/liquidscript.rb', line 210 def line @line end |
#line! ⇒ Object
200 201 202 203 204 205 206 207 208 |
# File 'lib/liquidscript/scanner/liquidscript.rb', line 200 def line! @line += 1 @cstart = @scanner.pos while @lexes.any? type, @start = @lexes.shift lex type end end |