Phase 6: Native Executables implementieren und Change archivieren

This commit is contained in:
2026-09-07 14:16:32 +02:00
parent 993c3e7638
commit 60d37ec79d
28 changed files with 1951 additions and 215 deletions

View File

@@ -849,9 +849,14 @@ fn link(
Ok((result, debug_maps))
}
// Erst ein ausdrücklich erzeugter DebugCompiler bindet den Quellcompiler ein.
// Die reine Runtime kann dadurch den gleichen VM-Pfad ohne Parser/Codegenerator linken.
type DebugCompileFn = fn(&DebugCompiler, u16, &str, &str, bool) -> Result<DebugCode, String>;
/// Ephemeral symbol/link context, deliberately not part of TBC serialization.
#[derive(Clone)]
pub struct DebugCompiler {
compile_fn: DebugCompileFn,
modules: Vec<(Module, FormCatalog, DebugMap)>,
symbols: tb_frontend::sema::DebugSymbols,
slots: Vec<u16>,
@@ -914,6 +919,7 @@ impl ProjectCompiler {
}
}
DebugCompiler {
compile_fn: DebugCompiler::compile_impl,
modules,
symbols,
slots,
@@ -928,6 +934,15 @@ impl DebugCompiler {
procedure: &str,
text: &str,
expression: bool,
) -> Result<DebugCode, String> {
(self.compile_fn)(self, module, procedure, text, expression)
}
fn compile_impl(
&self,
module: u16,
procedure: &str,
text: &str,
expression: bool,
) -> Result<DebugCode, String> {
if let Some(error) = &self.error {
return Err(error.clone());