From af34b3030a46805f42f04341f1ffb20d92fbb7ce Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 24 Oct 2021 18:26:01 +0200 Subject: Array literals and array access --- src/parse/ast/nodes.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/parse/ast/nodes.rs') diff --git a/src/parse/ast/nodes.rs b/src/parse/ast/nodes.rs index 617a01c..bffaea3 100644 --- a/src/parse/ast/nodes.rs +++ b/src/parse/ast/nodes.rs @@ -57,14 +57,14 @@ impl UnaryOperator { } #[derive(Debug, Clone)] -pub enum Literal { +pub enum SimpleLiteral { Int(u32), Float(f32), Str(String), Bool(bool), } -impl Literal { +impl SimpleLiteral { pub fn from_token(token: Token) -> Self { match token.variant { Int(int) => Self::Int(int), @@ -111,6 +111,11 @@ pub struct FnNode { pub body: BlockNode, } +#[derive(Debug, Clone)] +pub struct ArrayNode { + pub elements: Vec, +} + #[derive(Debug, Clone)] pub struct FnHeader { pub has_self_receiver: bool, -- cgit 1.4.1