diff options
| author | Mel <einebeere@gmail.com> | 2021-10-24 18:26:01 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2021-10-24 18:26:01 +0200 |
| commit | af34b3030a46805f42f04341f1ffb20d92fbb7ce (patch) | |
| tree | affed084f5d1d31921b44142428f18d725ed2cea /src/parse/ast/nodes.rs | |
| parent | 73c4808c44f75b7d6546f00f70779fcbf8e28754 (diff) | |
| download | rabbithole-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.rs | 9 |
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>, |
