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
// SPDX-License-Identifier: MIT
// Copyright (c) 2026 Moderately AI Inc.
//! Extension-point plumbing (ADR-0009): the `Spanned` / `Extension` traits and the uninhabited `NoExt` default.
use crateSpan;
use Debug;
use Hash;
/// Return the source span for an AST node.
///
/// Concrete node impls are generated by `squonk-sourcegen`; M1 only defines the
/// trait so extension nodes can promise span-aware behaviour.
/// The stock parser extension type.
///
/// This type is uninhabited, so `Other(NoExt)` variants are statically dead and
/// do not increase stock AST node sizes.
/// A custom AST extension node.
///
/// The extension design also names `Render` and `Visit` bounds, but M1 deliberately omits
/// them here to avoid an AST -> renderer/generated-code layering cycle. The
/// renderer and visitors add those bounds at their own call sites.
// Blanket on purpose — ADR-0009 fixes `Extension` as a bound-alias forever (behaviour
// lands on `Render`/`Visit` at call sites, never here); new behaviour = a new opt-in trait.