Module | Parslet::ClassMethods |
In: |
lib/parslet.rb
|
Define an entity for the parser. This generates a method of the same name that can be used as part of other patterns. Those methods can be freely mixed in your parser class with real ruby methods.
class MyParser include Parslet rule(:bar) { str('bar') } rule(:twobar) do bar >> bar end root :twobar end