Skip to content

Commit

Permalink
Some basic tokenizer logic fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 10, 2008
1 parent 462fe79 commit 4644dae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mojoshader_assembler.c
Expand Up @@ -220,7 +220,7 @@ static int _tokenize(Context *ctx)
ch = '\n';
} // else if

if ((ch > '0') && (ch < '9'))
if ((ch >= '0') && (ch <= '9'))
{
// starting a number, but rest of current token was not number.
if ((idx > 0) && ((ctx->prevchar < '0') || (ctx->prevchar > '9')))
Expand All @@ -232,7 +232,7 @@ static int _tokenize(Context *ctx)
else
{
// starting a non-number, but rest of current token was numbers.
if ((idx > 0) && ((ctx->prevchar >= '0') || (ctx->prevchar <= '9')))
if ((idx > 0) && ((ctx->prevchar >= '0') && (ctx->prevchar <= '9')))
{
ctx->token[idx++] = '\0';
return NOFAIL;
Expand All @@ -249,7 +249,7 @@ static int _tokenize(Context *ctx)
{
ctx->token[idx++] = ch;
ctx->source++;
if ((ch == '/') && (ctx->source[1] == '/'))
if ((ch == '/') && (*ctx->source == '/'))
{
ctx->token[idx++] = '/';
ctx->source++;
Expand Down

0 comments on commit 4644dae

Please sign in to comment.