-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
48 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ mod new; | |
pub mod utils; | ||
|
||
pub use self::{build::Build, new::New}; | ||
pub use zinkc::cli::Compile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//! Zink compiler. | ||
#![deny(missing_docs)] | ||
#![cfg(feature = "cli")] | ||
|
||
use ccli::{clap, App, Parser, Result}; | ||
use zinkc::cli::Compile; | ||
|
||
/// The Zink Compiler. | ||
#[derive(Debug, Parser)] | ||
#[command(name = "zinkc", version, arg_required_else_help(true))] | ||
pub struct Zinkc { | ||
#[clap(flatten)] | ||
command: Compile, | ||
/// Verbose mode (-v, -vv, -vvv, etc.) | ||
#[clap(short, long, action = clap::ArgAction::Count)] | ||
verbose: u8, | ||
} | ||
|
||
impl App for Zinkc { | ||
fn verbose(&self) -> u8 { | ||
self.verbose | ||
} | ||
|
||
fn run(&self) -> anyhow::Result<()> { | ||
self.command.run() | ||
} | ||
} | ||
|
||
/// The main function. | ||
fn main() -> Result<()> { | ||
Zinkc::start() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ pub use crate::{ | |
result::{Error, Result}, | ||
}; | ||
|
||
pub mod cli; | ||
mod compiler; | ||
mod config; | ||
mod parser; | ||
|