Expand description
The front end’s nesting ceiling: a count, and the host stack that count implies.
The front end recurses over structure the user chose — nested parentheses, nested blocks, a
macro that expands into more of itself, a type inside a type. Every one of those is a host
frame, and until this module existed nothing counted them:
docs/42-security-assurance.md §42.2 measured an
~7.6 KB file that aborted beck check in a debug build with no span and nothing catchable.
The bound is a count, for the reason
docs/adr/0007 gave
for the evaluator’s: a stack-headroom budget accepts a program in a release build and refuses it
in a debug one, and a diagnostic that depends on the profile is not a diagnostic.
docs/adr/0012 makes
that argument for the front end.
It lives in this crate because three crates share it — beck-syntax reads, beck-macro
expands, beck-core checks — and a ceiling with three definitions is three ceilings.
Structs§
- Nesting
- A recursion counter, held by whatever is recursing.
Constants§
- MAX_
BLOCK - How many statements one block may hold before the front end refuses it.
- MAX_
NESTING - How deep the front end will follow user-chosen structure before it refuses.
- STACK_
BYTES - The host stack the front end needs to reach
MAX_NESTINGon every one of its recursions.
Functions§
- on_
the_ front_ end_ stack - Run
fon a thread that hasSTACK_BYTES, and give back what it returned.