1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Syntax-directed operations over the tree (ECMAScript §8.2, §8.3).
//!
//! The specification defines its early errors in terms of operations like `VarDeclaredNames` and
//! `ContainsUndefinedContinueTarget`, each written piecewise over grammar productions. These are
//! those operations, and DR-0007 has the argument for computing them here rather than tracking
//! the answers in the parser: the specification is the oracle, and a function whose body can be
//! read next to its section is the only version of it that can be checked.
//!
//! - `names` — `LexicallyDeclaredNames` and `VarDeclaredNames` (§8.2.6, §8.2.8), and the
//! asymmetry between them that most of the scope rules turn on.
//! - `labels` — `ContainsDuplicateLabels`, `ContainsUndefinedBreakTarget` and
//! `ContainsUndefinedContinueTarget` (§8.3), and the two nesting rules that go with them.
//!
//! # Every walk here is iterative
//!
//! A `Stmt` already has one recursive path over it that no walk can avoid: its own destructor.
//! `Block(Box<[Stmt]>)` drops its children, which drop theirs, and measured in a debug build
//! against a mebibyte that runs out at about 3,500 levels. So a tree deeper than that cannot
//! safely exist at all, whoever built it — which puts a ceiling on what any argument about walks
//! can be worth, and is comfortably above the parser's cap of 48.
//!
//! What an iterative walk buys, then, is not a bigger number. It is that `Drop` stays the *only*
//! recursive path over the tree, so there is one limit to know rather than one per operation —
//! and these are public functions over a public tree, so each new one would otherwise add its
//! own. The `labels` module shows what it costs when the walk carries state: a set per node,
//! held as indices into one arena rather than as a set cloned down every branch.
pub use ;
pub use ;
use crateSpan;
/// A name some construct declares, and where it was written.