aboutsummaryrefslogtreecommitdiff
path: root/source/20-codegen-compiler
diff options
context:
space:
mode:
Diffstat (limited to 'source/20-codegen-compiler')
-rw-r--r--source/20-codegen-compiler/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/20-codegen-compiler/main.cpp b/source/20-codegen-compiler/main.cpp
index 326e4a9..c1559ec 100644
--- a/source/20-codegen-compiler/main.cpp
+++ b/source/20-codegen-compiler/main.cpp
@@ -846,6 +846,10 @@ void HandleInputFile(AppState& as, std::string_view filenameStem, std::string_vi
ps.currentEnumBraceDepth = ps.currentBraceDepth;
}
+ // NOTE: we parse the whole enum at once (above code), the enum ends right here after the closing brace '}'
+ ps.currentEnum = nullptr;
+ ps.currentEnumBraceDepth = -1;
+
goto endCaseCLEX_id;
}
@@ -1034,13 +1038,13 @@ void HandleInputFile(AppState& as, std::string_view filenameStem, std::string_vi
}
ps.currentStruct = nullptr;
- ps.currentStructBraceDepth = 0;
+ ps.currentStructBraceDepth = -1;
}
if (ps.currentEnum && ps.currentBraceDepth == ps.currentEnumBraceDepth) {
// Exit enum
ps.currentEnum = nullptr;
- ps.currentEnumBraceDepth = 0;
+ ps.currentEnumBraceDepth = -1;
}
} break;
}