Scaffolding for evaluation function

This commit is contained in:
greg 2015-07-18 15:00:18 -07:00
parent b2e23bed86
commit c6a92728ee

View File

@ -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;
}
}