Print tokens and parse
This commit is contained in:
parent
3fdacf018e
commit
b2e23bed86
@ -33,8 +33,11 @@ fn repl() {
|
|||||||
let line = stdin.lock().read_line(&mut buf);
|
let line = stdin.lock().read_line(&mut buf);
|
||||||
match line {
|
match line {
|
||||||
Ok(n) => {
|
Ok(n) => {
|
||||||
let result = tokenize(&buf);
|
let tokens = tokenize(&buf);
|
||||||
println!("Tokens: {:?}", result);
|
println!("Tokens: {:?}", tokens);
|
||||||
|
|
||||||
|
let ast = parse(tokens);
|
||||||
|
println!("AST: {:?}", ast);
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
println!("Error: {}", err);
|
println!("Error: {}", err);
|
||||||
|
Loading…
Reference in New Issue
Block a user