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
//! The `ElseIf` gates the control-flow rows share across families
//! (#1697). Each is emitted per language because the kind ids differ;
//! what the gate reads is the same, and so is the reason it is read off
//! the walk's chain rather than through `Node::parent` /
//! `Node::prev_sibling`, which resolve the parent by descending from the
//! root (#1084, #1584). The per-language rationale — which grammar
//! shape makes the gate the right one — stays beside each invocation,
//! per `docs/development/formatting.md`.
/// `continues_else_clause`: an `if` whose parent is the grammar's
/// `$clause` kind — the `else if` of the C and JS families, whose
/// grammars wrap the chained `if` in an `else_clause` and put a nested
/// one (`else { if … }`) under a block.
/// `follows_else_keyword`: an `if` whose previous sibling is the bare
/// `$keyword` token — the `else if` of Java, Groovy, C# and Kotlin,
/// whose grammars have no clause wrapper, so a nested `if` under
/// `else { … }` is told apart by its previous sibling being `{`. Through
/// `Ancestors::previous_sibling_has_kind`: a binary search through the
/// walk's `SiblingCache` on a wide parent, a short scan on a narrow one.
pub use ;