Class: Japko::Parser

Inherits:
Parslet::Parser
  • Object
show all
Defined in:
lib/japko.rb

Instance Method Summary collapse

Instance Method Details

#curly_braced(atom) ⇒ Object



12
13
14
# File 'lib/japko.rb', line 12

def curly_braced(atom)
  str('{') >> atom >> str('}')
end

#maybe_spaced(atom) ⇒ Object



16
17
18
# File 'lib/japko.rb', line 16

def maybe_spaced(atom)
  space? >> atom >> space?
end

#quoted(atom) ⇒ Object



8
9
10
# File 'lib/japko.rb', line 8

def quoted(atom)
  quote >> atom >> quote
end