Skip to content

Commit

Permalink
Note about emulating context
Browse files Browse the repository at this point in the history
  • Loading branch information
FayCarsons committed Jan 16, 2025
1 parent 3f1cb49 commit 405b59e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/parser/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ Notes for anyone working on this
- Type errors will point towards unrelated sections of the parser or give you incorrect information
about what has gone wrong.

- If you need to emulate some sort of context like "paragraphs can't accept '|' tokens if they're inside
tables", then you need to parameterize that rule by some other rule which dictates what it can accept.
For example, toplevel block elements match `paragraph(any_symbol)` and tables match
`paragraph(symbols_except_bar)`

- Be as specific as possible. Avoid optional tokens when possible. Prefer the non-empty
list rules (`sequence_nonempty`, `sequence_separated_nonempty`) over the alternatives.
Ambiguity will produce a compile-time reduce/reduce rule if you're lucky, unexpected
Expand Down

0 comments on commit 405b59e

Please sign in to comment.