Class: Rsec::LookAhead

Inherits:
Binary
  • Object
show all
Defined in:
lib/rsec/parsers/misc.rb

Overview

look ahead

Instance Attribute Summary

Attributes inherited from Binary

#left, #right

Attributes included from Parser

#name

Instance Method Summary collapse

Methods included from Parser

#&, #*, #<<, #>>, #^, #cached, #eof, #fail, #inspect, #join, #map, #maybe, #parse, #parse!, #star, #|

Instance Method Details

#_parse(ctx) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/rsec/parsers/misc.rb', line 53

def _parse ctx
  res = left()._parse ctx
  pos = ctx.pos
  return INVALID if INVALID[right()._parse ctx]
  ctx.pos = pos
  res
end