Class: L43Peg::Input
- Inherits:
-
Object
- Object
- L43Peg::Input
- Extended by:
- L43::OpenObject
- Defined in:
- lib/l43_peg/input.rb
Instance Method Summary collapse
- #debug ⇒ Object
- #drop(by = nil) ⇒ Object
- #empty? ⇒ Boolean
- #head_hr(n, position: false) ⇒ Object
- #position ⇒ Object
- #position_hr ⇒ Object
Instance Method Details
#debug ⇒ Object
9 10 11 12 13 |
# File 'lib/l43_peg/input.rb', line 9 def debug "Input<" + ["col:#{col}", "input:#{input.inspect}", "lnb:#{lnb}", "context:#{context.inspect}"].join(" ") + ">" end |
#drop(by = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/l43_peg/input.rb', line 15 def drop(by=nil) case by when nil _drop_by_n(1) when String _drop_by_n(by.length) else _drop_by_n(by) end end |
#empty? ⇒ Boolean
26 |
# File 'lib/l43_peg/input.rb', line 26 def empty? = input.empty? |
#head_hr(n, position: false) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/l43_peg/input.rb', line 28 def head_hr(n, position: false) if position "Input<#{input[0...n].inspect}@#{position_hr}>" else "Input<#{input[0...n].inspect}>" end end |
#position ⇒ Object
36 |
# File 'lib/l43_peg/input.rb', line 36 def position = [@col, @lnb] |
#position_hr ⇒ Object
38 |
# File 'lib/l43_peg/input.rb', line 38 def position_hr = [@col, @lnb].join(":") |