Class: ActionDispatch::Journey::Scanner
- Inherits:
-
Object
- Object
- ActionDispatch::Journey::Scanner
- Defined in:
- lib/action_dispatch/journey/scanner.rb
Overview
:nodoc:
Defined Under Namespace
Classes: Scanner
Constant Summary collapse
- STATIC_TOKENS =
Array.new(150)
Instance Method Summary collapse
-
#initialize ⇒ Scanner
constructor
A new instance of Scanner.
- #last_literal ⇒ Object
- #last_string ⇒ Object
- #next_token ⇒ Object
- #scan_setup(str) ⇒ Object
Constructor Details
#initialize ⇒ Scanner
Returns a new instance of Scanner.
28 29 30 31 |
# File 'lib/action_dispatch/journey/scanner.rb', line 28 def initialize @scanner = nil @length = nil end |
Instance Method Details
#last_literal ⇒ Object
48 49 50 51 52 |
# File 'lib/action_dispatch/journey/scanner.rb', line 48 def last_literal last_str = @scanner.string.byteslice(@scanner.pos - @length, @length) last_str.tr! "\\", "" -last_str end |
#last_string ⇒ Object
44 45 46 |
# File 'lib/action_dispatch/journey/scanner.rb', line 44 def last_string -@scanner.string.byteslice(@scanner.pos - @length, @length) end |
#next_token ⇒ Object
37 38 39 40 41 42 |
# File 'lib/action_dispatch/journey/scanner.rb', line 37 def next_token return if @scanner.eos? until token = scan || @scanner.eos?; end token end |