Skip to content

Commit

Permalink
Merge pull request #233 from katomuso/master
Browse files Browse the repository at this point in the history
Add documentation on nth and only-tags PEG specials
  • Loading branch information
bakpakin authored Sep 14, 2024
2 parents c88a558 + 28a8e2b commit 8f4ee5c
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 8f4ee5c

Please sign in to comment.