From dbd12e20d537662ceb2c1a3d3e4a4ed38076d073 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 2 Nov 2010 14:55:33 -0400 Subject: [PATCH] Workaround for failing parse for now. --- mojoshader_compiler.c | 6 +++--- mojoshader_parser_hlsl.lemon | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mojoshader_compiler.c b/mojoshader_compiler.c index bd766b9c..f0dde777 100644 --- a/mojoshader_compiler.c +++ b/mojoshader_compiler.c @@ -328,7 +328,7 @@ static inline const char *find_variable(Context *ctx, const char *sym) static void destroy_symbolmap(Context *ctx, SymbolMap *map) { while (map->scope) - pop_symbol_scope(ctx, map); + pop_symbol(ctx, map); hash_destroy(map->hash); } // destroy_symbolmap @@ -2265,13 +2265,13 @@ static void parse_source(Context *ctx, const char *filename, { // "float2" int len = snprintf(buf, sizeof (buf), "%s%d", types[i], j); - push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), NULL); + push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), "?"); int k; for (k = 1; k <= 4; k++) { // "float2x2" len = snprintf(buf, sizeof (buf), "%s%dx%d", types[i], j, k); - push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), NULL); + push_usertype(ctx, stringcache_len(ctx->strcache, buf, len), "?"); } // for } // for } // for diff --git a/mojoshader_parser_hlsl.lemon b/mojoshader_parser_hlsl.lemon index d31445f9..b190016a 100644 --- a/mojoshader_parser_hlsl.lemon +++ b/mojoshader_parser_hlsl.lemon @@ -95,8 +95,8 @@ compilation_unit(A) ::= struct_declaration(B) SEMICOLON. { A = new_global_struct %type typedef { MOJOSHADER_astTypedef * } %destructor typedef { delete_typedef(ctx, $$); } // !!! FIXME: should CONST be here, or in datatype? -typedef(A) ::= TYPEDEF CONST datatype(B) scalar_or_array(C). { A = new_typedef(ctx, 1, B, C); push_usertype(ctx, C->identifier, NULL); } -typedef(A) ::= TYPEDEF datatype(B) scalar_or_array(C). { A = new_typedef(ctx, 0, B, C); push_usertype(ctx, C->identifier, NULL); } +typedef(A) ::= TYPEDEF CONST datatype(B) scalar_or_array(C). { A = new_typedef(ctx, 1, B, C); push_usertype(ctx, C->identifier, "?"); } +typedef(A) ::= TYPEDEF datatype(B) scalar_or_array(C). { A = new_typedef(ctx, 0, B, C); push_usertype(ctx, C->identifier, "?"); } %type function_signature { MOJOSHADER_astFunctionSignature * } %destructor function_signature { delete_function_signature(ctx, $$); } @@ -224,7 +224,7 @@ struct_declaration(A) ::= struct_intro(B) LBRACE struct_member_list(C) RBRACE. { // This has to be separate from struct_declaration so that the struct is in the usertypemap when parsing its members. %type struct_intro { const char * } -struct_intro(A) ::= STRUCT IDENTIFIER(B). { A = B.string; push_usertype(ctx, A, NULL); } +struct_intro(A) ::= STRUCT IDENTIFIER(B). { A = B.string; push_usertype(ctx, A, "?"); } %type struct_member_list { MOJOSHADER_astStructMembers * } %destructor struct_member_list { delete_struct_member(ctx, $$); }