Browse Source

cppparser: Allow referencing enumerant within enum scope

rdb 2 years ago
parent
commit
bc039a0476
2 changed files with 1894 additions and 1882 deletions
  1. 1884 1881
      dtool/src/cppparser/cppBison.cxx.prebuilt
  2. 10 1
      dtool/src/cppparser/cppBison.yxx

File diff suppressed because it is too large
+ 1884 - 1881
dtool/src/cppparser/cppBison.cxx.prebuilt


+ 10 - 1
dtool/src/cppparser/cppBison.yxx

@@ -2971,8 +2971,17 @@ base_specification:
         ;
         ;
 
 
 enum:
 enum:
-        enum_decl '{' enum_body '}'
+        enum_decl
 {
 {
+  if (current_enum->_scope != nullptr) {
+    push_scope(current_enum->_scope);
+  }
+}
+        '{' enum_body '}'
+{
+  if (current_enum->_scope != nullptr) {
+    pop_scope();
+  }
   $$ = current_enum;
   $$ = current_enum;
   current_enum = nullptr;
   current_enum = nullptr;
 }
 }

Some files were not shown because too many files changed in this diff