aboutsummaryrefslogtreecommitdiff
path: root/bpeg.bpeg
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-09-13 22:04:51 -0700
committerBruce Hill <bruce@bruce-hill.com>2020-09-13 22:04:51 -0700
commit1570dd55e8f3601e72893d6954044317973d7c60 (patch)
treedb3169b0d18a8e8d3930d73819c6a20d95c5a7b3 /bpeg.bpeg
parent1d1c3d35aae0e060a6527d6e83575dd7ff71328e (diff)
Changed "upto-and" syntax to ".."/"..."
Diffstat (limited to 'bpeg.bpeg')
-rw-r--r--bpeg.bpeg10
1 files changed, 5 insertions, 5 deletions
diff --git a/bpeg.bpeg b/bpeg.bpeg
index 3301155..39e0f3f 100644
--- a/bpeg.bpeg
+++ b/bpeg.bpeg
@@ -7,14 +7,14 @@ Def = @[name]Ref __ `= __ @[definition]extended-pat;
String-pattern = *(`\ pat ?`; / .);
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;
+simple-pat = Empty / Upto / Dot / String / Char-range / Char / Escape-range / Escape / No / Anything-but
+ / Repeat / After / Before / Capture / Replace / Ref / parens;
suffixed-pat = Eq-pat;
Eq-pat = @[first]simple-pat "==" @[second]pat;
Empty = `/ >(__ (`)/`}));
-Dot = `.;
+Dot = `. !`.;
String = (
`" @[s]*(Escape / ~`") `"
/ `' @[s]*(Escape / ~`') `'
@@ -30,7 +30,7 @@ escape-sequence = (
);
No = `! _ @pat;
Anything-but = `~ ?`~ _ @pat;
-Upto-and = `& ?`& _ @pat;
+Upto = 2-3`. ?>(_@pat);
Repeat = (
@[min]int _ `- _ @[max]int
/{@[min]{=>"0"}=>} @[max]int _ `-
@@ -64,7 +64,7 @@ $ = !.;
^^ = !<$.;
^ = !<.;
-hash-comment = `# *.;
+hash-comment = `# .. $;
# Note: comments are undefined by default in regular BPEG
comment = hash-comment;