Experiment with nested source authoring against source3 models

This commit is contained in:
2026-09-05 19:22:42 +03:00
parent 06b33848ce
commit c5788fc15e
12 changed files with 1438 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
//! One-file command-line harness for inspecting the actual lowering result.
use oa_core::{language, source_project::SourceBundle};
use std::{collections::BTreeMap, env, fs, process::ExitCode};
fn main() -> ExitCode {
let args: Vec<_> = env::args().skip(1).collect();
if args.len() != 1 {
eprintln!(
"Usage: source-authoring-experiment B_SOURCE_FILE\nIncludes require the library's explicit SourceBundle API."
);
return ExitCode::FAILURE;
}
let result = fs::read_to_string(&args[0])
.map_err(|error| error.to_string())
.and_then(|text| {
source_authoring_experiment::compile(&SourceBundle {
entry: "project.arcadia".into(),
files: BTreeMap::from([("project.arcadia".into(), text)]),
})
});
match result {
Ok(project) => {
print!("{}", language::format(&project));
ExitCode::SUCCESS
}
Err(error) => {
eprintln!("{error}");
ExitCode::FAILURE
}
}
}