mirror of
https://github.com/enso-org/enso.git
synced 2024-11-29 15:52:13 +03:00
1.2 KiB
1.2 KiB
layout | title | category | tags | order | ||
---|---|---|---|---|---|---|
developer-doc | AST | parser |
|
9 |
AST
The parser AST describes the high-level syntactic structure of Enso, as well as containing robust and descriptive parser errors directly in the AST.
Functionality
The parser AST needs to account for the following:
- A single
Name
type, removing the distinction between different names found in the lexer. This should provide functionsis_var
,is_opr
, andis_ref
. - It should contain all of the language constructs that may appear in Enso's source.
- It should contain
Invalid
nodes, but these should be given a descriptive error as to why the construct is invalid. - It should also contain
Ambiguous
nodes, where a macro cannot be resolved in an unambiguous fashion.
Each node should contain:
- An identifier, attributed to it from the ID map.
- The start source position of the node, and the length (span) of the node.
The actionables for this section are:
- Flesh out the design for the AST based on the requirements of the various parser phases.