Skip to content

Commit

Permalink
Workaround for failing parse for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Nov 2, 2010
1 parent 9671da5 commit dbd12e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions mojoshader_compiler.c
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions mojoshader_parser_hlsl.lemon
Expand Up @@ -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, $$); }
Expand Down Expand Up @@ -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, $$); }
Expand Down

0 comments on commit dbd12e2

Please sign in to comment.