Skip to content

Commit

Permalink
Final example
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Jul 29, 2019
1 parent 49e8c9a commit 728c115
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions grammars/sym-and-arg.p6
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
use v6;

grammar Foo {
token TOP { (.) {} <bar> }
token TOP { (.) {} <bar>+ }
proto token bar {*}
token bar:sym<alpha> { <alpha>+ }
token bar:sym<digit> { <digit>+ }
token bar:sym<x> { <sym>+ }
token bar:sym<z> { <sym>+ }
token bar:sym<1> { <sym>+ }
token bar:sym<0> { <sym>+ }
}

say Foo.parse("xxz");
Expand Down

0 comments on commit 728c115

Please sign in to comment.