STUDIO HAZE · topaz
Topaz source
Open by house policy. Topaz is our own language.
Topaz 5.20 · 56 files
compiler/crates/topaz_self_frontend/topaz/dev/text_self_build.tpz
Topaz · 545 B · Original file
1
import emitter.rust_text { rustStr }3
// A small executable path through the emitter's source encoder. The mutable4
// cursor is shared by a named nested function and a lambda across each loop.5
export function main(args: Array<string>, input: string) -> Result<int, string> {6
let mut ordinal = 07
function next() -> int {8
let current = ordinal9
ordinal += 110
current11
}12
let emit = (line: string) => {13
"pub const TEXT_{next()}: &str = {rustStr(line)};"14
}15
for line in input.split("\n") {16
print(emit(line))17
}18
Ok(0)19
}SHA256 756dc641d1d44bfe8d6248de4e3298bd0f1751dae5a0604bc040d2e42eaf5a7a