aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-09-14 11:36:16 -0700
committerBruce Hill <bruce@bruce-hill.com>2020-09-14 11:36:16 -0700
commit45c4fb1049d3f083e932875b1ecd7cb70eb3b507 (patch)
tree3afa104664318525a457df9c5e912cab7958df96
parent57669a2d704253d8458371b6ba64fd7af6da9e26 (diff)
Tweaks and docs
-rw-r--r--bpeg.14
-rw-r--r--grammars/builtins.bpeg4
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<pat1>\fR and \fI<pat2>\fR both match and have the exact
same length. Pronounced \fI<pat1>\fB-assuming-it-equals-\fI<pat2>\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;