about summary refs log tree commit diff
path: root/src/parse/ast/nodes.rs
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-10-24 18:26:01 +0200
committerMel <einebeere@gmail.com>2021-10-24 18:26:01 +0200
commitaf34b3030a46805f42f04341f1ffb20d92fbb7ce (patch)
treeaffed084f5d1d31921b44142428f18d725ed2cea /src/parse/ast/nodes.rs
parent73c4808c44f75b7d6546f00f70779fcbf8e28754 (diff)
downloadrabbithole-af34b3030a46805f42f04341f1ffb20d92fbb7ce.tar.zst
rabbithole-af34b3030a46805f42f04341f1ffb20d92fbb7ce.zip
Array literals and array access
Diffstat (limited to 'src/parse/ast/nodes.rs')
-rw-r--r--src/parse/ast/nodes.rs9
1 files changed, 7 insertions, 2 deletions
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),
@@ -112,6 +112,11 @@ pub struct FnNode {
 }
 
 #[derive(Debug, Clone)]
+pub struct ArrayNode {
+    pub elements: Vec<Expression>,
+}
+
+#[derive(Debug, Clone)]
 pub struct FnHeader {
     pub has_self_receiver: bool,
     pub parameters: Vec<TypedIdentifier>,