Skip to content

Commit

Permalink
Add test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaredanwolfgang committed Dec 9, 2024
1 parent 4282d98 commit 3ef3662
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ members = [
clap = "4.5.22"
colored = "2.1.0"
llvm-ir = { version = "0.11.1", features = ["llvm-17"] }
spl_parser = { path = "src/parser" }
spl_parser = { path = "src/parser" }
spl_analyser = { path = "src/analyser" }
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extern crate llvm_ir as llvm;

use spl_parser::{parse_from_file};
use spl_analyser::walker::Walker;
use clap::{Arg, Command};
use colored::Colorize;
// use std::ffi::CString;
Expand All @@ -27,6 +28,13 @@ fn main() {
}
}

let mut walker = Walker::new(&source_path);
walker.traverse();
let errors = walker.get_errors();
for error in errors {
println!("{}", error.to_string().red());
}

// unsafe {
// codegen(parsed_input);
// }
Expand Down
2 changes: 1 addition & 1 deletion src/parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ mod tests {

#[test]
fn test_0_r00() {
assert_parse_from_file(Parser::FuncDecParser, "../test/test_0_r00.spl","../test/test_0_r00.out");
assert_parse_from_file(Parser::FuncDecParser, "../test/mid/test_syntax_2.spl","../test/mid/test_syntax_2.out");
}

#[test]
Expand Down

0 comments on commit 3ef3662

Please sign in to comment.