aboutsummaryrefslogtreecommitdiff
path: root/bpeg.bpeg
diff options
context:
space:
mode:
Diffstat (limited to 'bpeg.bpeg')
-rw-r--r--bpeg.bpeg8
1 files changed, 6 insertions, 2 deletions
diff --git a/bpeg.bpeg b/bpeg.bpeg
index 0a03aa8..3301155 100644
--- a/bpeg.bpeg
+++ b/bpeg.bpeg
@@ -4,10 +4,14 @@ Grammar = __ *Def%(__`;__) ?(`;__);
Def = @[name]Ref __ `= __ @[definition]extended-pat;
# This is used for command line arguments:
-String-grammar = *(`\ pat ?`; / .);
+String-pattern = *(`\ pat ?`; / .);
-pat = Empty / Dot / String / Char-range / Char / Escape-range / Escape / No / Anything-but
+pat = suffixed-pat / simple-pat;
+simple-pat = Empty / Dot / String / Char-range / Char / Escape-range / Escape / No / Anything-but
/ Upto-and / Repeat / After / Before / Capture / Replace / Ref / parens;
+suffixed-pat = Eq-pat;
+
+Eq-pat = @[first]simple-pat "==" @[second]pat;
Empty = `/ >(__ (`)/`}));
Dot = `.;