From dbdae42c1b604e079681ae56c2954c5abb22c1e2 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 22 Jul 2015 02:51:49 -0700 Subject: [PATCH] Add string to AST --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 1edefca..03e537d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,6 +28,7 @@ enum Token { #[derive(Debug)] enum ASTNode { Name(String), + LangString(String), Number(f64), BinOp(Box, Box, Box), Binding(String, Box) @@ -181,7 +182,7 @@ fn let_expression<'a>(input: &mut Iter) -> ParseResult { } if let Some(&StrLiteral(ref value)) = next { - let ast = ASTNode::Binding(name.clone(), Box::new(ASTNode::Name(value.clone()))); + let ast = ASTNode::Binding(name.clone(), Box::new(ASTNode::LangString(value.clone()))); return ParseResult::Ok(ast); }