From 45c4fb1049d3f083e932875b1ecd7cb70eb3b507 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 14 Sep 2020 11:36:16 -0700 Subject: Tweaks and docs --- bpeg.1 | 4 ++++ grammars/builtins.bpeg | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bpeg.1 b/bpeg.1 index 4f2c18c..6088e44 100644 --- a/bpeg.1 +++ b/bpeg.1 @@ -145,6 +145,10 @@ be a string, and it may contain references to captured values: \fB@0\fR Will match only if \fI\fR and \fI\fR both match and have the exact same length. Pronounced \fI\fB-assuming-it-equals-\fI\fR +.B | +This pattern matches the indentation at the beginning of a line that has the +same indentation as the line before (or zero indentation on the first line). + .B (/) The empty string (a pattern that always matches). diff --git a/grammars/builtins.bpeg b/grammars/builtins.bpeg index df03104..b90ac12 100644 --- a/grammars/builtins.bpeg +++ b/grammars/builtins.bpeg @@ -8,8 +8,8 @@ only-matches = +{...@pattern=>'@1\n'}; matching-line = +(..@pattern) ..$; # Helper definitions (commonly used) -indent = \n |+(\t/' '); -dedent = >(\n !|); +indent = \n|+(\t/' '); +dedent = $ !(\n|); indented-block = |` ..$ *(\n|..$); crlf = \r\n; cr = \r; r = \r; -- cgit v1.2.3