Skip to content

Commit

Permalink
Removed SEMANTIC token...we can do this with IDENTIFIER.
Browse files Browse the repository at this point in the history
The less the parser has to do, the better!
  • Loading branch information
icculus committed Feb 21, 2010
1 parent 33af148 commit 65bd8ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions mojoshader_compiler.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion mojoshader_parser_hlsl.lemon
Expand Up @@ -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 }
Expand Down

0 comments on commit 65bd8ec

Please sign in to comment.