Skip to content

Commit

Permalink
Basic demo
Browse files Browse the repository at this point in the history
  • Loading branch information
rozukke committed Aug 9, 2024
1 parent 3e38bee commit 6dae223
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#![allow(unused)] // Remove later

use std::fs;

use clap::{Parser, Subcommand};
use colored::Colorize;
use lexer::{tokenize, TokenKind};

mod lexer;
mod ops;
mod runtime;
mod span;
mod symbol;

/// Lace is a complete & convenient assembler toolchain for the LC3 assembly language.
Expand Down Expand Up @@ -60,7 +64,12 @@ fn main() {
if let Some(command) = args.command {
match command {
Command::Run { os, name } => todo!(),
Command::Compile { name, dest } => todo!(),
Command::Compile { name, dest } => {
let file = fs::read_to_string(name).unwrap();
for tok in tokenize(&file).filter(|tok| tok.kind != TokenKind::Junk) {
println!("{:?} {}", tok, &file[tok.span.as_range()]);
}
}
Command::Clean { name } => todo!(),
Command::Watch { name } => todo!(),
Command::Fmt { name } => todo!(),
Expand Down

0 comments on commit 6dae223

Please sign in to comment.