From cc537f292d0a0ea28af8fb88ac1c73382ffc111d Mon Sep 17 00:00:00 2001 From: greg Date: Sat, 4 Feb 2017 14:53:51 -0800 Subject: [PATCH] Starting Maaru AST --- src/maaru_lang/mod.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/maaru_lang/mod.rs b/src/maaru_lang/mod.rs index 7bdcc6a..18f0b34 100644 --- a/src/maaru_lang/mod.rs +++ b/src/maaru_lang/mod.rs @@ -43,8 +43,18 @@ pub enum Number { FloatRep(String) } +pub type AST = Vec; + #[derive(Debug)] -pub struct AST { } +pub enum ASTNode { + FunctionDefinition(String, Expression), + ImportStatement(String), +} + +#[derive(Debug)] +pub enum Expression { + +} impl ProgrammingLanguage for Maaru { type Token = Token; @@ -131,7 +141,7 @@ impl ProgrammingLanguage for Maaru { } fn parse(_input: Vec) -> Result { - Ok(AST { }) + Ok(vec!()) } fn evaluate(_ast: Self::AST, _evaluator: &mut Self::Evaluator) -> Vec { vec!["Unimplemented".to_string()]