Scaffolding for evaluation function
This commit is contained in:
parent
b2e23bed86
commit
c6a92728ee
14
src/main.rs
14
src/main.rs
@ -38,6 +38,9 @@ fn repl() {
|
||||
|
||||
let ast = parse(tokens);
|
||||
println!("AST: {:?}", ast);
|
||||
|
||||
let eval = evaluate(&ast);
|
||||
println!("{}", eval);
|
||||
},
|
||||
Err(err) => {
|
||||
println!("Error: {}", err);
|
||||
@ -63,3 +66,14 @@ fn tokenize(input: &str) -> Vec<Token> {
|
||||
fn parse(_input: Vec<Token>) -> ASTNode {
|
||||
ASTNode::GenericNode
|
||||
}
|
||||
|
||||
fn evaluate(input: &ASTNode) -> String {
|
||||
|
||||
return match eval_ast(input) {
|
||||
ASTNode::GenericNode => "Not implemented".to_string()
|
||||
};
|
||||
|
||||
fn eval_ast(_input: &ASTNode) -> ASTNode {
|
||||
return ASTNode::GenericNode;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user