Added some FIXMEs.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 12 Jan 2011 03:39:21 -0500
changeset 975 95b03c82cf51
parent 974 e4c4963e8889
child 976 72f121a58548
Added some FIXMEs.
mojoshader_compiler.c
mojoshader_parser_hlsl.lemon
--- a/mojoshader_compiler.c	Wed Jan 12 03:44:28 2011 -0500
+++ b/mojoshader_compiler.c	Wed Jan 12 03:39:21 2011 -0500
@@ -2795,6 +2795,8 @@
             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
@@ -4021,7 +4023,7 @@
 
             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;
 
--- a/mojoshader_parser_hlsl.lemon	Wed Jan 12 03:44:28 2011 -0500
+++ b/mojoshader_parser_hlsl.lemon	Wed Jan 12 03:39:21 2011 -0500
@@ -175,6 +175,7 @@
 %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 }