]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
recognize the simple case of __FUNC__ in the parser
authorWolfgang Bumiller <wry.git@bumiller.com>
Wed, 24 Apr 2013 09:21:04 +0000 (11:21 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Wed, 24 Apr 2013 09:21:10 +0000 (11:21 +0200)
parser.c

index cc0d6f3f536a03b6815331a95d6a90a6b49329e5..d480e1ffd6598ee983a7474027a03cb90060aa50 100755 (executable)
--- a/parser.c
+++ b/parser.c
@@ -1888,6 +1888,8 @@ static bool parse_sya_operand(parser_t *parser, shunt *sy, bool with_labels)
                 vec_push(parser->labels, lbl);
             }
         }
+        if (!var && !strcmp(parser_tokval(parser), "__FUNC__"))
+            var = (ast_expression*)parser_const_string(parser, parser->function->name, false);
         if (!var) {
             /* intrinsics */
             if (!strcmp(parser_tokval(parser), "__builtin_debug_typestring")) {