From 28a8e2b0dab6abc1610b1eb14ad2356db75dd606 Mon Sep 17 00:00:00 2001 From: Kato Muso Date: Fri, 13 Sep 2024 04:32:12 +0000 Subject: [PATCH] Add documentation on nth and only-tags PEG specials --- content/docs/peg.mdz | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/docs/peg.mdz b/content/docs/peg.mdz index 2d6f3c3..6721466 100644 --- a/content/docs/peg.mdz +++ b/content/docs/peg.mdz @@ -337,6 +337,14 @@ grammars simpler. @tr{@td{@code`(drop patt)` } @td{ Ignores (drops) all captures from patt. }} + @tr{@td{@code`(only-tags patt)` } + @td{ Ignores all captures from @code`patt`, while making tagged + captures within @code`patt` available for future back-referencing. }} + + @tr{@td{@code`(nth index patt ?tag)` } + @td{ Capture one of the captures in @code`patt` at @code`index`. + If no such capture exists, then the match fails. }} + @tr{@td{@code`(uint num-bytes ?tag)` } @td{ Capture a little endian, unsigned, two's complement integer from @code`num-bytes`. Works for 1 to 8 byte integers. }}