]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
Actually works now
[xonotic/gmqcc.git] / parser.c
index 5b4ed658f96f5236ed04f7db1aed7d1a4dabd534..06aca6bf3acd3d2eb7ac6f1e81066f5d0a14f00e 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -5770,22 +5770,29 @@ skipvar:
             }
         }
 
-        if (parser->tok != '{' || var->expression.vtype != TYPE_FUNCTION) {
-            if (parser->tok != '=') {
-                parseerror(parser, "missing semicolon or initializer, got: `%s`", parser_tokval(parser));
-                break;
-            }
+        if ((OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_HCODE)
+                ? parser->tok != ':'
+                : true
+        ){
+            if (parser->tok != '{' || var->expression.vtype != TYPE_FUNCTION) {
+                if (parser->tok != '=') {
+                    parseerror(parser, "missing semicolon or initializer, got: `%s`", parser_tokval(parser));
+                    break;
+                }
 
-            if (!parser_next(parser)) {
-                parseerror(parser, "error parsing initializer");
-                break;
+                if (!parser_next(parser)) {
+                    parseerror(parser, "error parsing initializer");
+                    break;
+                }
+            }
+            else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_QCC) {
+                parseerror(parser, "expected '=' before function body in this standard");
             }
-        }
-        else if (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_QCC) {
-            parseerror(parser, "expected '=' before function body in this standard");
         }
 
-        if (parser->tok == '#') {
+        if (parser->tok == '#' ||
+            (OPTS_OPTION_U32(OPTION_STANDARD) == COMPILER_HCODE && parser->tok == ':'))
+        {
             ast_function *func   = NULL;
             ast_value    *number = NULL;
             float         fractional;