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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Surface-level syntax translation between languages.
//!
//! `normalize-surface-syntax` provides a common IR for imperative code and
//! translates between language syntaxes (TypeScript, Lua, etc.) at the
//! surface level - it maps syntax, not deep semantics.
//!
//! # Architecture
//!
//! ```text
//! Source Languages IR Target Languages
//! ──────────────── ───────────── ────────────────────
//! TypeScript ─┐ ┌─> TypeScript
//! Lua ─┼─> Program ─────┼─> Lua
//! (future) ─┘ (ir.rs) └─> (future)
//! ```
//!
//! # Example
//!
//! ```ignore
//! use normalize_surface_syntax::{input, output};
//!
//! // Read TypeScript
//! let ir = input::read_typescript("const x = 1 + 2;")?;
//!
//! // Write to Lua
//! let lua = output::LuaWriter::emit(&ir);
//! // => "local x = (1 + 2)"
//! ```
//!
//! # S-Expression Format
//!
//! The IR can be serialized to a compact S-expression format (JSON arrays):
//! - `["std.let", "x", 1]` → variable binding
//! - `["math.add", left, right]` → binary operation
//! - `["console.log", "hello"]` → function call
//!
//! This format is used for storage (e.g., lotus verbs).
//!
//! # Note on Translation Fidelity
//!
//! This is **surface-level** translation, not semantic transpilation like
//! Haxe or ReScript. The IR captures syntax structure; domain semantics
//! are handled by the runtime (e.g., spore).
// Re-exports: IR types
pub use ;
// Re-exports: Traits
pub use ;
// Re-exports: Registry
pub use ;
// Re-exports: Built-in readers
pub use read_typescript;
pub use TypeScriptReader;
// Re-exports: Built-in writers
pub use LuaWriter;
pub use LuaWriterImpl;
pub use ;