Class: Rsec::Pattern

Inherits:
Unary
  • Object
show all
Defined in:
lib/rsec/parsers/misc.rb,
lib/rsec/helpers.rb

Overview

matches a pattern

Instance Attribute Summary

Attributes inherited from Unary

#some

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



89
90
91
# File 'lib/rsec/parsers/misc.rb', line 89

def _parse ctx
  ctx.scan some() or INVALID
end

#until(&p) ⇒ Object

@ desc.r

Scan until the pattern happens


393
394
395
# File 'lib/rsec/helpers.rb', line 393

def until &p
  UntilPattern[some()].map p
end