Expand description
Structural height limits for syntax and typed trees.
The parser’s recursion budget does not bound tree height: operator, postfix and statement-level chains are parsed iteratively, and inference lowers flat syntax such as template literals into nested operations. Every later compiler walk recurses over these trees, so their height is measured iteratively and rejected before a recursive phase can consume them.
Constants§
- MAX_
SYNTAX_ HEIGHT - Height of parsed syntax, counting expressions, statements and type annotations.
- MAX_
TYPED_ HEIGHT - Height of the typed tree after inference and lowering, which may add wrapper nodes and expand flat syntax such as template literal substitutions.
Functions§
- check_
syntax - Rejects parsed syntax whose recursive walks could exhaust the compiler stack.
- check_
typed - Rejects a typed tree whose recursive walks could exhaust the compiler stack.