hard reseet
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
use anyhow::Result;
|
||||
use clap::{Parser, Subcommand};
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Command line interface for the Prometeu Compiler.
|
||||
#[derive(Parser)]
|
||||
#[command(name = "prometeu-build-pipeline")]
|
||||
#[command(version, about = "Official compiler for the PROMETEU Virtual Machine", long_about = None)]
|
||||
pub struct Cli {
|
||||
/// The action to perform (build or verify).
|
||||
#[command(subcommand)]
|
||||
pub command: Commands,
|
||||
}
|
||||
|
||||
/// Available subcommands for the compiler.
|
||||
#[derive(Subcommand)]
|
||||
pub enum Commands {
|
||||
/// Builds a Prometeu project by compiling source code into a PBC file.
|
||||
Build {
|
||||
/// Path to the project root directory.
|
||||
project_dir: PathBuf,
|
||||
|
||||
/// Explicit path to the entry file (defaults to src/main.pbs).
|
||||
#[arg(short, long)]
|
||||
entry: Option<PathBuf>,
|
||||
|
||||
/// Path to save the compiled .pbc file.
|
||||
#[arg(short, long)]
|
||||
out: Option<PathBuf>,
|
||||
|
||||
/// Whether to generate a .json symbols file for source mapping.
|
||||
#[arg(long, default_value_t = true)]
|
||||
emit_symbols: bool,
|
||||
|
||||
/// Disable symbol generation.
|
||||
#[arg(long)]
|
||||
no_symbols: bool,
|
||||
|
||||
/// Whether to generate a .disasm file for debugging.
|
||||
#[arg(long, default_value_t = true)]
|
||||
emit_disasm: bool,
|
||||
|
||||
/// Disable disassembly generation.
|
||||
#[arg(long)]
|
||||
no_disasm: bool,
|
||||
|
||||
/// Whether to explain the dependency resolution process.
|
||||
#[arg(long)]
|
||||
explain_deps: bool,
|
||||
},
|
||||
/// Verifies if a Prometeu project is syntactically and semantically valid without emitting code.
|
||||
Verify {
|
||||
/// Path to the project root directory.
|
||||
project_dir: PathBuf,
|
||||
|
||||
/// Whether to explain the dependency resolution process.
|
||||
#[arg(long)]
|
||||
explain_deps: bool,
|
||||
},
|
||||
}
|
||||
|
||||
/// Main entry point for the compiler library's execution logic.
|
||||
/// Parses CLI arguments and dispatches to the appropriate compiler functions.
|
||||
pub fn run() -> Result<()> {
|
||||
let cli = Cli::parse();
|
||||
|
||||
match cli.command {
|
||||
Commands::Build {
|
||||
project_dir,
|
||||
out,
|
||||
emit_disasm,
|
||||
no_disasm,
|
||||
emit_symbols,
|
||||
no_symbols,
|
||||
explain_deps,
|
||||
..
|
||||
} => {
|
||||
|
||||
}
|
||||
Commands::Verify {
|
||||
project_dir,
|
||||
explain_deps
|
||||
} => {
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
mod cli;
|
||||
|
||||
pub use cli::run;
|
||||
@@ -0,0 +1,7 @@
|
||||
use anyhow::Result;
|
||||
|
||||
/// Main entry point for the Prometeu Compiler binary.
|
||||
/// It delegates execution to the library's `run` function.
|
||||
fn main() -> Result<()> {
|
||||
prometeu_build_pipeline::run()
|
||||
}
|
||||
Reference in New Issue
Block a user