Removed SEMANTIC token...we can do this with IDENTIFIER.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 20 Feb 2010 20:31:00 -0500
changeset 838 37e901d1b7bf
parent 837 5f6528602658
child 839 40e990813f41
Removed SEMANTIC token...we can do this with IDENTIFIER. The less the parser has to do, the better!
mojoshader_compiler.c
mojoshader_parser_hlsl.lemon
--- a/mojoshader_compiler.c	Sat Feb 20 00:27:28 2010 -0500
+++ b/mojoshader_compiler.c	Sat Feb 20 20:31:00 2010 -0500
@@ -1462,8 +1462,7 @@
     return strtod(str, NULL);
 } // strtodouble
 
-
-
+#if 0
 // This does not check correctness (POSITIONT993842 passes, etc).
 static int is_semantic(const Context *ctx, const char *token,
                        const unsigned int tokenlen)
@@ -1498,7 +1497,7 @@
 
     return 0;
 } // is_semantic
-
+#endif
 
 static int convert_to_lemon_token(const Context *ctx, const char *token,
                                   unsigned int tokenlen, const Token tokenval)
@@ -1746,9 +1745,7 @@
 
             #undef tokencmp
 
-            if (is_semantic(ctx, token, tokenlen))
-                return TOKEN_HLSL_SEMANTIC;
-            else if (is_usertype(ctx, token, tokenlen))
+            if (is_usertype(ctx, token, tokenlen))
                 return TOKEN_HLSL_USERTYPE;
             return TOKEN_HLSL_IDENTIFIER;
 
@@ -1813,7 +1810,6 @@
                 data.dbl = strtodouble(token, tokenlen);
                 break;
 
-            case TOKEN_HLSL_SEMANTIC:
             case TOKEN_HLSL_USERTYPE:
             case TOKEN_HLSL_STRING_LITERAL:
             case TOKEN_HLSL_IDENTIFIER:
--- a/mojoshader_parser_hlsl.lemon	Sat Feb 20 00:27:28 2010 -0500
+++ b/mojoshader_parser_hlsl.lemon	Sat Feb 20 20:31:00 2010 -0500
@@ -162,7 +162,7 @@
 input_modifier(A) ::= UNIFORM. { A = INPUTMOD_UNIFORM; }
 
 %type semantic { const char * }
-semantic(A) ::= COLON SEMANTIC(B). { A = B.string; }
+semantic(A) ::= COLON IDENTIFIER(B). { A = B.string; }
 
 // DX10 only?
 %type interpolation_mod { InterpolationModifier }