Make all structs and classes at the Module level static

This commit is contained in:
Tristan B. Kildaire 2021-06-06 17:59:46 +02:00
parent bedd9639a2
commit 3a9a43b258
1 changed files with 6 additions and 0 deletions

View File

@ -1281,6 +1281,9 @@ public final class Parser
{ {
Clazz clazz = parseClass(); 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 */ /* Add the class definition to the program */
modulle.addStatement(clazz); modulle.addStatement(clazz);
} }
@ -1289,6 +1292,9 @@ public final class Parser
{ {
Struct ztruct = parseStruct(); 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 */ /* Add the struct definition to the program */
modulle.addStatement(ztruct); modulle.addStatement(ztruct);
} }