Skip to content

Commit

Permalink
Add documentation on nth and only-tags PEG specials
Browse files Browse the repository at this point in the history
  • Loading branch information
katomuso committed Sep 13, 2024
1 parent c88a558 commit 28a8e2b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/docs/peg.mdz
Original file line number Diff line number Diff line change
Expand Up @@ -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. }}
Expand Down

0 comments on commit 28a8e2b

Please sign in to comment.