Updated everything and moved to hard tab indentation

This commit is contained in:
2025-01-08 19:20:34 +01:00
parent 7cdfe7e3c4
commit 52c8d1c95a
100 changed files with 5949 additions and 5998 deletions

View File

@@ -6,8 +6,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
camino = "1.1.7"
clap = { version = "=4.5.4", features = ["derive"] }
itertools = "0.13.0"
camino = "1.1.9"
clap = { version = "4.5.24", features = ["derive"] }
itertools = "0.14.0"
orchid-base = { version = "0.1.0", path = "../orchid-base" }
orchid-host = { version = "0.1.0", path = "../orchid-host" }

View File

@@ -9,44 +9,44 @@ use itertools::Itertools;
use orchid_base::interner::intern;
use orchid_base::logging::{LogStrategy, Logger};
use orchid_base::tree::ttv_fmt;
use orchid_host::extension::{init_systems, Extension};
use orchid_host::extension::{Extension, init_systems};
use orchid_host::lex::lex;
use orchid_host::subprocess::Subprocess;
#[derive(Parser, Debug)]
#[command(version, about, long_about)]
pub struct Args {
#[arg(short, long)]
extension: Vec<Utf8PathBuf>,
#[arg(short, long)]
system: Vec<String>,
#[command(subcommand)]
command: Commands,
#[arg(short, long)]
extension: Vec<Utf8PathBuf>,
#[arg(short, long)]
system: Vec<String>,
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Lex {
#[arg(short, long)]
file: Utf8PathBuf,
},
Lex {
#[arg(short, long)]
file: Utf8PathBuf,
},
}
fn main() {
let args = Args::parse();
let logger = Logger::new(LogStrategy::StdErr);
match args.command {
Commands::Lex { file } => {
let extensions = (args.extension.iter())
.map(|f| Subprocess::new(Command::new(f.as_os_str()), logger.clone()).unwrap())
.map(|cmd| Extension::new_process(Arc::new(cmd), logger.clone()).unwrap())
.collect_vec();
let systems = init_systems(&args.system, &extensions).unwrap();
let mut file = File::open(file.as_std_path()).unwrap();
let mut buf = String::new();
file.read_to_string(&mut buf).unwrap();
let lexemes = lex(intern(&buf), &systems).unwrap();
println!("{}", ttv_fmt(&lexemes))
},
}
let args = Args::parse();
let logger = Logger::new(LogStrategy::StdErr);
match args.command {
Commands::Lex { file } => {
let extensions = (args.extension.iter())
.map(|f| Subprocess::new(Command::new(f.as_os_str()), logger.clone()).unwrap())
.map(|cmd| Extension::new_process(Arc::new(cmd), logger.clone()).unwrap())
.collect_vec();
let systems = init_systems(&args.system, &extensions).unwrap();
let mut file = File::open(file.as_std_path()).unwrap();
let mut buf = String::new();
file.read_to_string(&mut buf).unwrap();
let lexemes = lex(intern(&buf), &systems).unwrap();
println!("{}", ttv_fmt(&lexemes))
},
}
}