feat: reactivityl; vdom; rhei; styles; fs; image element

This commit is contained in:
Faynot
2026-06-02 12:12:20 +03:00
commit f956b750e3
16 changed files with 7713 additions and 0 deletions

64
src/main.rs Normal file
View File

@@ -0,0 +1,64 @@
mod app;
mod cli;
mod interpreter;
mod renderer;
use clap::{Parser, Subcommand};
#[derive(Debug, Clone)]
pub enum Message {
EventTriggered(String),
InputChanged(Option<String>, String),
ToggleChanged(Option<String>, bool),
SliderChanged(Option<String>, f64),
}
#[derive(Parser)]
#[command(name = "glint-runtime")]
#[command(author, version, about = "Glint runtime compile and run .gltm/.glts files", long_about = None)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
Compile {
#[arg(required = true)]
gltm_files: Vec<String>,
#[arg(short = 's', long = "style")]
glts_files: Vec<String>,
#[arg(short = 'o', long = "output")]
output: Option<String>,
},
Run {
/// Bytecode file to execute
file: String,
},
}
fn main() {
let cli = Cli::parse();
match cli.command {
Commands::Compile {
gltm_files,
glts_files,
output,
} => {
let output_path = output.unwrap_or_else(|| {
std::path::Path::new(&gltm_files[0])
.with_extension("glbc")
.to_string_lossy()
.to_string()
});
cli::compile_files(&gltm_files, &glts_files, &output_path);
}
Commands::Run { file } => {
cli::run_file(&file);
}
}
}