Skip to content

Commit

Permalink
add a note about the WHITESPACE and COMMENT inner rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtau committed Feb 7, 2024
1 parent f09d149 commit f4ad611
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/grammars/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ main = { SOI ~ expression ~ EOI }
(Be sure to mark the `WHITESPACE` and `COMMENT` rules as [silent] unless you
want to see them included inside other rules!)

If you want the `WHITESPACE` and `COMMENT` inner rules included,
note that you need to mark the rule with an explicit `$`:

```
COMMENT = ${ SingleLineComment }
SingleLineComment = { "//" ~ (!"\n" ~ ANY)* }
```

[sequence]: #sequence
[repetition]: #repetition
[atomic rules]: #atomic
Expand Down

0 comments on commit f4ad611

Please sign in to comment.