Workaround for failing parse for now.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 02 Nov 2010 14:55:33 -0400
changeset 937 94e50ba3f956
parent 936 b4a15ef390c4
child 938 fc5240c4f197
Workaround for failing parse for now.
mojoshader_compiler.c
mojoshader_parser_hlsl.lemon
--- a/mojoshader_compiler.c	Tue Nov 02 14:55:10 2010 -0400
+++ b/mojoshader_compiler.c	Tue Nov 02 14:55:33 2010 -0400
@@ -328,7 +328,7 @@
 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 @@
         {
             // "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
--- a/mojoshader_parser_hlsl.lemon	Tue Nov 02 14:55:10 2010 -0400
+++ b/mojoshader_parser_hlsl.lemon	Tue Nov 02 14:55:33 2010 -0400
@@ -95,8 +95,8 @@
 %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 @@
 
 // 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, $$); }