Browse Source

Fix for preprocessor conditional compilation inside class declarations

mingodad 4 years ago
parent
commit
03df048c55
1 changed files with 6 additions and 3 deletions
  1. 6 3
      SquiLu/squirrel/sqcompiler.cpp

+ 6 - 3
SquiLu/squirrel/sqcompiler.cpp

@@ -2125,6 +2125,12 @@ start_again:
         int addClassMember = 0;
         while(_token != terminator)
         {
+            checkEatPragma();
+            if(_token == TK_PRAGMA) {
+                    Pragma();
+                    continue;
+            }
+
             bool hasattrs = false;
             bool isstatic = false;
             bool cppDestructor = false;
@@ -2134,9 +2140,6 @@ start_again:
             const SQChar *membertypename = 0;
             SQInteger member_type_token = 0;
 
-            checkEatPragma();
-            if(_token == TK_PRAGMA) Pragma();
-
             //check if is an attribute
             if(isClass)
             {