Fixed dropping pieces of structs with comma-separated members.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 19 Jan 2011 01:04:40 -0800
changeset 984 b75637d50945
parent 983 665e2d8bd7de
child 985 bea4dafa2782
Fixed dropping pieces of structs with comma-separated members.
mojoshader_parser_hlsl.lemon
--- a/mojoshader_parser_hlsl.lemon	Tue Jan 18 13:49:42 2011 -0800
+++ b/mojoshader_parser_hlsl.lemon	Wed Jan 19 01:04:40 2011 -0800
@@ -231,7 +231,7 @@
 %type struct_member_list { MOJOSHADER_astStructMembers * }
 %destructor struct_member_list { delete_struct_member(ctx, $$); }
 struct_member_list(A) ::= struct_member(B). { A = B; }
-struct_member_list(A) ::= struct_member_list(B) struct_member(C). { A = C; A->next = B; }
+struct_member_list(A) ::= struct_member_list(B) struct_member(C). { A = C; MOJOSHADER_astStructMembers *i = A; while (i->next) { i = i->next; } i->next = B; }
 
 %type struct_member { MOJOSHADER_astStructMembers * }
 %destructor struct_member { delete_struct_member(ctx, $$); }