From 13645f6b6b80f307ec581420e87d5a647c496f62 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Mon, 31 May 2021 18:14:15 +0200 Subject: [PATCH] Append Statement objects to build up struct's body --- source/tlang/compiler/parsing/core.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/tlang/compiler/parsing/core.d b/source/tlang/compiler/parsing/core.d index f68374f..b82c0b6 100644 --- a/source/tlang/compiler/parsing/core.d +++ b/source/tlang/compiler/parsing/core.d @@ -298,6 +298,7 @@ public final class Parser gprintln("parseStruct(): Enter", DebugType.WARNING); Struct generatedStruct; + Statement[] statements; /* Consume the `struct` that caused `parseStruct` to be called */ nextToken(); @@ -325,7 +326,6 @@ public final class Parser /* The possibly valid returned struct member (Entity) */ Statement structMember; - /** TODO: * We only want to allow function definitions and variable * declarations here (WIP: for now without assignments) @@ -379,7 +379,8 @@ public final class Parser expect("Only function definitions and variable declarations allowed in struct body"); } - + /* Append to struct's body */ + statements ~= structMember;