Document a few gotchas

pull/204/head
Jonathan Arnett 2022-01-02 13:45:21 +07:00
parent 4648a013e7
commit b27cc2673b
1 changed files with 15 additions and 0 deletions

@ -10,6 +10,21 @@ This grammar is able to parse the entire Gleam language. It is largely based
on the Gleam parser itself, and deviations from that are noted throughout the on the Gleam parser itself, and deviations from that are noted throughout the
codebase. codebase.
Various Gotchas
---------------
There are a few nodes in the generated AST that may be confusing at first:
- `type` :: A very ambiguous name, but this refers to a concrete type such as
`List(#(String, Int))`
- `type_name` :: Refers to essentially the left side of a type declaration, and
includes parameters, e.g. `MyType(foo, bar)`.
- `type_identifier` :: Known in the parser as "UpName", this is what you would
intuitively think of as a type's name, such as `List` or `Result`.
This is not a comprehensive list. If you find a node confusing, search for it
in `grammar.js`, as it might have an explanatory comment. Either way, feel free
to add it to this list and send a PR! ✨
## DONE ## DONE
- [x] Parsing - [x] Parsing