Browse Source

Interrogate now parses "volatile" qualifier in instance identifiers correctly

rdb 10 years ago
parent
commit
7f3f546cdd

+ 20 - 0
dtool/src/cppparser/cppBison.yxx

@@ -1233,6 +1233,11 @@ instance_identifier:
 {
 {
   $$ = $2;
   $$ = $2;
   $$->add_modifier(IIT_const);
   $$->add_modifier(IIT_const);
+}
+        | KW_VOLATILE instance_identifier  %prec UNARY
+{
+  $$ = $2;
+  $$->add_modifier(IIT_volatile);
 }
 }
         | '*' instance_identifier  %prec UNARY
         | '*' instance_identifier  %prec UNARY
 {
 {
@@ -1435,6 +1440,11 @@ not_paren_formal_parameter_identifier:
 {
 {
   $$ = $2;
   $$ = $2;
   $$->add_modifier(IIT_const);
   $$->add_modifier(IIT_const);
+}
+        | KW_VOLATILE not_paren_formal_parameter_identifier  %prec UNARY
+{
+  $$ = $2;
+  $$->add_modifier(IIT_volatile);
 }
 }
         | '*' not_paren_formal_parameter_identifier  %prec UNARY
         | '*' not_paren_formal_parameter_identifier  %prec UNARY
 {
 {
@@ -1480,6 +1490,11 @@ formal_parameter_identifier:
 {
 {
   $$ = $2;
   $$ = $2;
   $$->add_modifier(IIT_const);
   $$->add_modifier(IIT_const);
+}
+        | KW_VOLATILE formal_parameter_identifier  %prec UNARY
+{
+  $$ = $2;
+  $$->add_modifier(IIT_volatile);
 }
 }
         | '*' formal_parameter_identifier  %prec UNARY
         | '*' formal_parameter_identifier  %prec UNARY
 {
 {
@@ -1528,6 +1543,11 @@ empty_instance_identifier:
 {
 {
   $$ = $2;
   $$ = $2;
   $$->add_modifier(IIT_const);
   $$->add_modifier(IIT_const);
+}
+        | KW_VOLATILE empty_instance_identifier  %prec UNARY
+{
+  $$ = $2;
+  $$->add_modifier(IIT_volatile);
 }
 }
         | '*' empty_instance_identifier  %prec UNARY
         | '*' empty_instance_identifier  %prec UNARY
 {
 {

+ 5 - 0
dtool/src/cppparser/cppInstanceIdentifier.cxx

@@ -286,6 +286,11 @@ r_unroll_type(CPPType *start_type,
     result = new CPPConstType(r_unroll_type(start_type, mi));
     result = new CPPConstType(r_unroll_type(start_type, mi));
     break;
     break;
 
 
+  case IIT_volatile:
+    // Just pass it through for now.
+    result = r_unroll_type(start_type, mi);
+    break;
+
   case IIT_paren:
   case IIT_paren:
     result = r_unroll_type(start_type, mi);
     result = r_unroll_type(start_type, mi);
     break;
     break;

+ 1 - 0
dtool/src/cppparser/cppInstanceIdentifier.h

@@ -36,6 +36,7 @@ enum CPPInstanceIdentifierType {
   IIT_scoped_pointer,
   IIT_scoped_pointer,
   IIT_array,
   IIT_array,
   IIT_const,
   IIT_const,
+  IIT_volatile,
   IIT_paren,
   IIT_paren,
   IIT_func,
   IIT_func,
   IIT_initializer,
   IIT_initializer,

+ 1 - 1
makepanda/makepanda.py

@@ -1354,7 +1354,7 @@ def CompileIgate(woutd,wsrc,opts):
         # Assume that interrogate is on the PATH somewhere.
         # Assume that interrogate is on the PATH somewhere.
         cmd = 'interrogate'
         cmd = 'interrogate'
 
 
-    cmd += ' -srcdir %s -I%s -Dvolatile -Dmutable' % (srcdir, srcdir)
+    cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
     cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
     cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
     if (COMPILER=="MSVC"):
     if (COMPILER=="MSVC"):
         cmd += ' -D__inline -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32'
         cmd += ' -D__inline -D_X86_ -DWIN32_VC -DWIN32 -D_WIN32'