slint/sixtyfps_compiler/main.rs
Simon Hausmann c8b64f5c4b Remove the lowering
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.
2020-05-27 14:45:35 +02:00

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(())
}