diff --git a/trixy-parser/src/bin/trixy-parser.rs b/trixy-parser/src/bin/trixy-parser.rs index 2340ce7..3545150 100644 --- a/trixy-parser/src/bin/trixy-parser.rs +++ b/trixy-parser/src/bin/trixy-parser.rs @@ -51,6 +51,14 @@ pub enum Command { /// The file containing the trixy code to tokenize file: PathBuf, }, + #[clap(value_parser)] + /// Only try to tokenize the file + Lex { + #[clap(value_parser)] + /// The file containing the trixy code to tokenize + file: PathBuf, + }, + /// Check syntax, without type checking Parse { #[clap(value_parser)] @@ -75,7 +83,7 @@ pub enum Command { pub fn main() { let args = Args::parse(); match args.subcommand { - Command::Tokenize { file } => { + Command::Tokenize { file } | Command::Lex { file } => { let input = fs::read_to_string(file).unwrap(); let input_tokens = match TokenStream::lex(&input) {