class Ciphr::Parser
Public Instance Methods
pad(&p)
click to toggle source
# File lib/ciphr/parser.rb, line 4 def pad(&p) spaces? >> p.call >> spaces? end
wrapbraces(bs,&p)
click to toggle source
# File lib/ciphr/parser.rb, line 12 def wrapbraces(bs,&p) exp = str('') bs.each{|b| exp = ( str(b[0]) >> p.call >> str(b[1]) ) | exp } exp end
wrapstr(d)
click to toggle source
# File lib/ciphr/parser.rb, line 8 def wrapstr(d) str(d) >> ( str('\\') >> any | str(d).absent? >> any ).repeat.maybe.as(:string) >> str(d) end