Skip to content

Commit

Permalink
eggex.md: clarify zero-width assertions (#1418)
Browse files Browse the repository at this point in the history
The previous formatting and examples could mislead one
to think that %start %end is a dummy name
for a type of expression that has an opening and a closing marker
(and possibly some content within).

By splitting the code markup, adding a comma,
and using a second example that isn't complementary to the first one,
the actual syntax is made clearer.
  • Loading branch information
waldyrious committed Dec 4, 2022
1 parent f1e3ed4 commit 7a47d77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/eggex.md
Expand Up @@ -87,7 +87,7 @@ Eggexes have a consistent syntax:

- Single characters are unadorned, in lowercase: `dot`, `space`, or `s`
- A sequence of multiple characters looks like `'lit'`, `$var`, etc.
- Constructs that match **zero** characters look like `%start %end`
- Constructs that match **zero** characters look like `%start`, `%word_end`, etc.
- Entire subpatterns (which may contain alternation, repetition, etc.) are in
uppercase like `HexDigit`. Important: these are **spliced** as syntax trees,
not strings, so you **don't** need to think about quoting.
Expand Down

0 comments on commit 7a47d77

Please sign in to comment.