Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added some FIXMEs.
  • Loading branch information
icculus committed Jan 12, 2011
1 parent 80f9725 commit 81bf097
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mojoshader_compiler.c
Expand Up @@ -2795,6 +2795,8 @@ static const MOJOSHADER_astDataType *type_check_ast(Context *ctx, void *_ast)
dt->structure.member_count = count;
ast->structdecl.datatype = dt;

// !!! FIXME: this shouldn't push for anonymous structs: "struct { int x; } myvar;"
// !!! FIXME: but right now, the grammar is wrong and requires a name for the struct.
push_usertype(ctx, ast->structdecl.name, ast->structdecl.datatype);
return ast->structdecl.datatype;
} // case
Expand Down Expand Up @@ -4021,7 +4023,7 @@ static void parse_source(Context *ctx, const char *filename,

case TOKEN_HLSL_USERTYPE:
data.string = stringcache_len(ctx->strcache, token, tokenlen);
data.datatype = get_usertype(ctx, data.string);
data.datatype = get_usertype(ctx, data.string); // !!! FIXME: do we need this? It's kind of useless during parsing.
assert(data.datatype != NULL);
break;

Expand Down
1 change: 1 addition & 0 deletions mojoshader_parser_hlsl.lemon
Expand Up @@ -175,6 +175,7 @@ interpolation_mod(A) ::= SAMPLE. { A = MOJOSHADER_AST_INTERPMOD_SAMPLE; }
%destructor variable_declaration { delete_variable_declaration(ctx, $$); }
variable_declaration(A) ::= variable_attribute_list(B) datatype(C) variable_declaration_details_list(D) SEMICOLON. { REVERSE_LINKED_LIST(MOJOSHADER_astVariableDeclaration, D); A = D; A->attributes = B; A->datatype = C; }
variable_declaration(A) ::= datatype(B) variable_declaration_details_list(C) SEMICOLON. { REVERSE_LINKED_LIST(MOJOSHADER_astVariableDeclaration, C); A = C; A->datatype = B; }
// !!! FIXME: this expects "struct Identifier {} varname" ... that "Identifier" is wrong.
variable_declaration(A) ::= struct_declaration(B) variable_declaration_details_list(C) SEMICOLON. { REVERSE_LINKED_LIST(MOJOSHADER_astVariableDeclaration, C); A = C; A->anonymous_datatype = B; }

%type variable_attribute_list { int }
Expand Down

0 comments on commit 81bf097

Please sign in to comment.