Просмотр исходного кода

Make the compiler accept typedef of fixed size array "typedef int_t int_a8[8];"

mingodad 8 лет назад
Родитель
Сommit
60322d444e
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      SquiLu/squirrel/sqcompiler.cpp

+ 7 - 1
SquiLu/squirrel/sqcompiler.cpp

@@ -737,7 +737,7 @@ public:
                 Lex();
                 ExpectTypeToken(); //ignore for now
 			}
-			Expect('=');
+			Expect(_SC('='));
 			SQObjectPtr strongid = id;
 			CheckLocalNameScope(id, _scope.nested);
 			//CheckConstsExists(strongid);
@@ -774,6 +774,12 @@ public:
 			CheckLocalNameScope(id, _scope.nested);
 			//Expect(_SC(';'));
 			TypesNewSlot(strongid,SQObjectPtr(type_val));
+			if(_token == _SC('[')) //fixed size array
+            {
+                Lex();
+                Expect(TK_INTEGER);
+                Expect(_SC(']'));
+            }
 			}
 			break;
         case TK_USING: