Permalink
Browse files

Simplistic captures for peg.pg.

  • Loading branch information...
brixen committed Nov 6, 2010
1 parent bb5bca9 commit b86c96d0272199b1d91c4866ea7393c4e3e1ea99
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/pegarus/examples/peg.pg
@@ -1,7 +1,8 @@
grammar = (nonterminal '=' sp pattern)+
pattern = alternative ('/' sp alternative)*
-alternative = ([!&]? sp suffix)+
+alternative = ([!&]? sp suffix capture?)+
suffix = primary ([*+?] sp)*
+capture = '{' (!'}' .)* '}' sp
primary = '(' sp pattern ')' sp / '.' sp / literal /
char_class / nonterminal !'='
literal = ['] (!['] .)* ['] sp

0 comments on commit b86c96d

Please sign in to comment.