I noticed this code didn't work as advertised while doing some passing around
of TGSI shaders and trying to reparse them, and things failing.
This seems to fix it here for at least the small test case I hacked into a
graw test.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
cur2 = cur;
cur2++;
eat_opt_white( &cur2 );
- if (str_match_nocase_whole( &cur2, "ARRAY(" )) {
+ if (str_match_nocase_whole( &cur2, "ARRAY" )) {
int arrayid;
+ if (*cur2 != '(') {
+ report_error( ctx, "Expected `('" );
+ return FALSE;
+ }
+ cur2++;
eat_opt_white( &cur2 );
if (!parse_int( &cur2, &arrayid )) {
report_error( ctx, "Expected `,'" );
}
eat_opt_white( &cur2 );
if (*cur2 != ')') {
- report_error( ctx, "Expected `,'" );
+ report_error( ctx, "Expected `)'" );
return FALSE;
}
+ cur2++;
decl.Declaration.Array = 1;
decl.Array.ArrayID = arrayid;
- cur = cur2;
+ ctx->cur = cur = cur2;
}
}