From 65bd8ecaadf5556ccf68a82b8094e75f40829f6d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 20 Feb 2010 20:31:00 -0500 Subject: [PATCH] Removed SEMANTIC token...we can do this with IDENTIFIER. The less the parser has to do, the better! --- mojoshader_compiler.c | 10 +++------- mojoshader_parser_hlsl.lemon | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/mojoshader_compiler.c b/mojoshader_compiler.c index 115a9b2c..944ece55 100644 --- a/mojoshader_compiler.c +++ b/mojoshader_compiler.c @@ -1462,8 +1462,7 @@ static inline double strtodouble(const char *_str, unsigned int len) 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 @@ static int is_semantic(const Context *ctx, const char *token, 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 @@ static int convert_to_lemon_token(const Context *ctx, const char *token, #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 @@ void MOJOSHADER_compile(const char *filename, data.dbl = strtodouble(token, tokenlen); break; - case TOKEN_HLSL_SEMANTIC: case TOKEN_HLSL_USERTYPE: case TOKEN_HLSL_STRING_LITERAL: case TOKEN_HLSL_IDENTIFIER: diff --git a/mojoshader_parser_hlsl.lemon b/mojoshader_parser_hlsl.lemon index a70a7c78..811c4129 100644 --- a/mojoshader_parser_hlsl.lemon +++ b/mojoshader_parser_hlsl.lemon @@ -162,7 +162,7 @@ input_modifier(A) ::= OUT IN. { A = INPUTMOD_INOUT; } 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 }