From c6a92728eedc96f776052a550759a61bc53cf8be Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 18 Jul 2015 15:00:18 -0700 Subject: [PATCH] Scaffolding for evaluation function --- src/main.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main.rs b/src/main.rs index 81a2db7..21c5c4d 100644 --- a/src/main.rs +++ b/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 { fn parse(_input: Vec) -> 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; + } +}