Fixed DCL usage index parsing.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 12 Feb 2009 02:03:18 -0500
changeset 575 70bb1ba99a07
parent 574 71c06777f95e
child 576 d7ec39b7abab
Fixed DCL usage index parsing. "dcl_texcoord_pp" is valid, so we need to see if there's a '_' in there where we expect a number might be before parsing for an index value.
mojoshader_assembler.c
--- a/mojoshader_assembler.c	Thu Feb 12 01:58:14 2009 -0500
+++ b/mojoshader_assembler.c	Thu Feb 12 02:03:18 2009 -0500
@@ -1132,8 +1132,11 @@
 
     if (parse_dcl_usage(ctx, &usage, &issampler))
     {
-        if ( (ctx->tokenlen > 0) && (!ui32fromtoken(ctx, &index)) )
-            fail(ctx, "Expected usage index");
+        if ((ctx->tokenlen > 0) && (*ctx->token != '_'))
+        {
+            if (!ui32fromtoken(ctx, &index))
+                fail(ctx, "Expected usage index");
+        } // if
     } // if
 
     parse_destination_token(ctx);