Working on a testing method

This commit is contained in:
2025-05-26 22:28:31 +02:00
parent b61518de00
commit c8e72dbba8
10 changed files with 130 additions and 10 deletions

View File

@ -2,6 +2,9 @@ use anyhow::Result;
use clap::{Parser, Subcommand};
use libjrpc::{targets::rust::RustCompiler, FileProcessor};
#[cfg(test)]
mod test;
#[derive(Parser)]
struct Cli {
#[command(subcommand)]
@ -14,6 +17,7 @@ struct Cli {
enum Commands {
Compile {
input: String,
#[arg(short, long)]
output: String,
#[arg(short, long)]
definition: Option<String>,
@ -39,7 +43,18 @@ pub fn main() -> Result<()> {
let mut fp = FileProcessor::new();
let ir = fp.start_compile(&input)?;
libjrpc::targets::compile::<RustCompiler>(ir, &output)?;
let output_split = output.split(':').collect::<Vec<&str>>();
let output_target = output_split[0];
let output_dir = output_split[1];
match output_target {
"rust" => {
libjrpc::targets::compile::<RustCompiler>(ir, output_dir)?;
}
_ => {
println!("Unsupported target: {}", output_target);
}
}
//TODO: Implement definition output!
}