Class: Rsec::OneOf
Overview
one of char in string
Instance Attribute Summary
Attributes inherited from Unary
Attributes included from Parser
Instance Method Summary collapse
Methods included from Parser
#&, #*, #<<, #>>, #^, #cached, #eof, #fail, #inspect, #join, #map, #maybe, #parse, #parse!, #star, #|
Instance Method Details
#_parse(ctx) ⇒ Object
127 128 129 130 131 132 133 134 135 136 |
# File 'lib/rsec/parsers/misc.rb', line 127 def _parse ctx return INVALID if ctx.eos? chr = ctx.getch if some().index(chr) chr else ctx.pos = ctx.pos - 1 INVALID end end |