mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 13:24:48 +00:00

The LoweredItem and LoweredComponent contained, in essence, the same information as the Element and Component in object_tree. Since the moving declarations pass moved everything to the root element and the LoweredPropertyDeclarations have been removed as well, this is the last step.
25 lines
798 B
Rust
25 lines
798 B
Rust
use sixtyfps_compiler::*;
|
|
use structopt::StructOpt;
|
|
|
|
#[derive(StructOpt)]
|
|
struct Cli {
|
|
#[structopt(name = "path to .60 file", parse(from_os_str))]
|
|
path: std::path::PathBuf,
|
|
}
|
|
|
|
fn main() -> std::io::Result<()> {
|
|
let args = Cli::from_args();
|
|
let source = std::fs::read_to_string(&args.path)?;
|
|
let (syntax_node, mut diag) = parser::parse(&source);
|
|
diag.current_path = args.path;
|
|
//println!("{:#?}", syntax_node);
|
|
let mut tr = typeregister::TypeRegister::builtin();
|
|
let doc = object_tree::Document::from_node(syntax_node, &mut diag, &mut tr);
|
|
run_passes(&doc, &mut diag, &mut tr);
|
|
|
|
let (mut diag, source) = diag.check_and_exit_on_error(source);
|
|
|
|
generator::generate(&doc.root_component, &mut diag);
|
|
diag.check_and_exit_on_error(source);
|
|
Ok(())
|
|
}
|