Skip to main content

shape_runtime/
content_builders.rs

1//! Content namespace builder functions.
2//!
3//! Phase 1.B (ADR-006 §2.7.4 audit-accuracy ruling): the pre-bulldozer
4//! builders decoded `&[ValueWord]` arguments via tag-bit dispatch
5//! (`as_str()`, `as_any_array()`, `to_generic()`) and constructed
6//! results via `ValueWord::from_content` / `from_string`. The kind-
7//! threaded rebuild lands in Phase 2c alongside the broader content-
8//! tree marshalling migration; until then, every builder returns a
9//! deferred error rather than emit a partial / wrong-typed
10//! `ContentNode` payload.
11//!
12//! shape-vm consumers (`vm_impl/builtins.rs:556` etc.) call these
13//! handlers directly and break in the next-session shape-vm cleanup
14//! workstream per ADR-006 §2.7.5.
15
16use shape_ast::error::{Result, ShapeError};
17use shape_value::KindedSlot;
18
19fn deferred(name: &str) -> ShapeError {
20    ShapeError::RuntimeError {
21        message: format!(
22            "{}: pending Phase 2c content-tree kind threading — see ADR-006 §2.7.4",
23            name
24        ),
25        location: None,
26    }
27}
28
29pub fn content_text(_args: &[KindedSlot]) -> Result<KindedSlot> {
30    Err(deferred("Content.text"))
31}
32
33pub fn content_table(_args: &[KindedSlot]) -> Result<KindedSlot> {
34    Err(deferred("Content.table"))
35}
36
37pub fn content_chart(_args: &[KindedSlot]) -> Result<KindedSlot> {
38    Err(deferred("Content.chart"))
39}
40
41pub fn content_code(_args: &[KindedSlot]) -> Result<KindedSlot> {
42    Err(deferred("Content.code"))
43}
44
45pub fn content_kv(_args: &[KindedSlot]) -> Result<KindedSlot> {
46    Err(deferred("Content.kv"))
47}
48
49pub fn content_fragment(_args: &[KindedSlot]) -> Result<KindedSlot> {
50    Err(deferred("Content.fragment"))
51}
52
53pub fn color_named(_name: &str) -> Result<KindedSlot> {
54    Err(deferred("Color.named"))
55}
56
57pub fn color_rgb(_args: &[KindedSlot]) -> Result<KindedSlot> {
58    Err(deferred("Color.rgb"))
59}
60
61pub fn border_named(_name: &str) -> Result<KindedSlot> {
62    Err(deferred("Border.named"))
63}
64
65pub fn chart_type_named(_name: &str) -> Result<KindedSlot> {
66    Err(deferred("ChartType.named"))
67}
68
69pub fn align_named(_name: &str) -> Result<KindedSlot> {
70    Err(deferred("Align.named"))
71}