test program

This commit is contained in:
nora 2021-10-07 20:39:31 +02:00
parent 1ed076a5d3
commit bea961bbbd
4 changed files with 28 additions and 3 deletions

View file

@ -5,5 +5,11 @@ mod parse;
pub fn run_program(program: &str) {
let lexer = lex::Lexer::lex(program);
let tokens: Result<Vec<_>, _> = lexer.collect();
println!("{:#?}", tokens);
println!(
"{:#?}",
tokens.map(|tokens| tokens
.into_iter()
.map(|token| token.kind)
.collect::<Vec<_>>())
);
}