]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
Implement [[eraseable]] attribute. When used with a function it instructs the AST...
[xonotic/gmqcc.git] / parser.c
index ef206557b0a384a1dd5b69d47e91e78adf68f3c6..2277abf2b44f847b284dab87757d5ba0e5c0a7c4 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2738,7 +2738,15 @@ static bool parse_qualifiers(parser_t *parser, bool with_local, int *cvq, bool *
             else if (!strcmp(parser_tokval(parser), "inline")) {
                 flags |= AST_FLAG_INLINE;
                 if (!parser_next(parser) || parser->tok != TOKEN_ATTRIBUTE_CLOSE) {
-                    parseerror(parser, "`noref` attribute has no parameters, expected `]]`");
+                    parseerror(parser, "`inline` attribute has no parameters, expected `]]`");
+                    *cvq = CV_WRONG;
+                    return false;
+                }
+            }
+            else if (!strcmp(parser_tokval(parser), "eraseable")) {
+                flags |= AST_FLAG_ERASEABLE;
+                if (!parser_next(parser) || parser->tok != TOKEN_ATTRIBUTE_CLOSE) {
+                    parseerror(parser, "`eraseable` attribute has no parameters, expected `]]`");
                     *cvq = CV_WRONG;
                     return false;
                 }