0

I found in parslet gem introduction something like this:

# Without structure: just strings.
  str('ooo').parse('ooo')                           # => "ooo"@0
  str('o').repeat.parse('ooo')                      # => "ooo"@0

source: parslet gem

I did try this on irb (after require 'parslet') but it not working. Of course if I put this as a rule in a Parslet::Parser class it will work. My question is can we try parslet atom like above in irb? Is there any way to try that?

like this:

irb> require 'parslet'
irb> str('ooo').parse('ooo')
suhao399
  • 628
  • 7
  • 11

0 Answers0