From 3a9a43b258c4d78ee334ea273b6bdf5454b2c074 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sun, 6 Jun 2021 17:59:46 +0200 Subject: [PATCH] Make all structs and classes at the Module level static --- source/tlang/compiler/parsing/core.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/tlang/compiler/parsing/core.d b/source/tlang/compiler/parsing/core.d index c69044a..e88fcad 100644 --- a/source/tlang/compiler/parsing/core.d +++ b/source/tlang/compiler/parsing/core.d @@ -1281,6 +1281,9 @@ public final class Parser { Clazz clazz = parseClass(); + /* All classes declared at the Module level are static by default */ + clazz.setModifierType(InitScope.STATIC); + /* Add the class definition to the program */ modulle.addStatement(clazz); } @@ -1289,6 +1292,9 @@ public final class Parser { Struct ztruct = parseStruct(); + /* All structs declared at the Module level are static by default */ + ztruct.setModifierType(InitScope.STATIC); + /* Add the struct definition to the program */ modulle.addStatement(ztruct); }