Skip to content

Commit

Permalink
Renamed preprocessor_internal_lexer to preprocessor_lexer.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 18, 2009
1 parent 8a0d765 commit a818d5e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion mojoshader_internal.h
Expand Up @@ -404,7 +404,7 @@ typedef struct IncludeState
struct IncludeState *next;
} IncludeState;

Token preprocessor_internal_lexer(IncludeState *s);
Token preprocessor_lexer(IncludeState *s);

// This will only fail if the allocator fails, so it doesn't return any
// error code...NULL on failure.
Expand Down
4 changes: 2 additions & 2 deletions mojoshader_lexer.c
Expand Up @@ -39,7 +39,7 @@ static void update_state(IncludeState *s, const uchar *cur, const uchar *tok)
s->token = (const char *) tok;
} // update_state

Token preprocessor_internal_lexer(IncludeState *s)
Token preprocessor_lexer(IncludeState *s)
{
const uchar *cursor = (const uchar *) s->source;
const uchar *token;
Expand Down Expand Up @@ -1353,7 +1353,7 @@ Token preprocessor_internal_lexer(IncludeState *s)

assert(0 && "Shouldn't hit this code");
RET(TOKEN_UNKNOWN);
} // preprocessor_internal_lexer
} // preprocessor_lexer

// end of mojoshader_lexer_preprocessor.re (or .c) ...

4 changes: 2 additions & 2 deletions mojoshader_lexer.re
Expand Up @@ -55,7 +55,7 @@ static void update_state(IncludeState *s, int eoi,
s->tokenlen = (unsigned int) (s->source - s->token);
} // update_state

Token preprocessor_internal_lexer(IncludeState *s)
Token preprocessor_lexer(IncludeState *s)
{
const uchar *cursor = (const uchar *) s->source;
const uchar *token;
Expand Down Expand Up @@ -223,7 +223,7 @@ bad_chars:

assert(0 && "Shouldn't hit this code");
RET(TOKEN_UNKNOWN);
} // preprocessor_internal_lexer
} // preprocessor_lexer

// end of mojoshader_lexer_preprocessor.re (or .c) ...

28 changes: 14 additions & 14 deletions mojoshader_preprocessor.c
Expand Up @@ -18,13 +18,13 @@
#endif

#if DEBUG_LEXER
static Token debug_preprocessor_internal_lexer(IncludeState *s)
static Token debug_preprocessor_lexer(IncludeState *s)
{
const Token retval = preprocessor_internal_lexer(s);
const Token retval = preprocessor_lexer(s);
MOJOSHADER_print_debug_token("LEXER", s->token, s->tokenlen, retval);
return retval;
} // debug_preprocessor_internal_lexer
#define preprocessor_internal_lexer(s) debug_preprocessor_internal_lexer(s)
} // debug_preprocessor_lexer
#define preprocessor_lexer(s) debug_preprocessor_lexer(s)
#endif

typedef struct DefineHash
Expand Down Expand Up @@ -676,7 +676,7 @@ static int require_newline(IncludeState *state)
const char *source = state->source;
const unsigned int bytes_left = state->bytes_left;
const unsigned int linenum = state->line;
const Token token = preprocessor_internal_lexer(state);
const Token token = preprocessor_lexer(state);
state->source = source; // rewind no matter what.
state->bytes_left = bytes_left;
state->line = linenum;
Expand All @@ -689,7 +689,7 @@ static int require_newline(IncludeState *state)
static void handle_pp_include(Context *ctx)
{
IncludeState *state = ctx->include_stack;
Token token = preprocessor_internal_lexer(state);
Token token = preprocessor_lexer(state);
MOJOSHADER_includeType incltype;
char *filename = NULL;
int bogus = 0;
Expand Down Expand Up @@ -763,7 +763,7 @@ static void handle_pp_line(Context *ctx)
int linenum = 0;
int bogus = 0;

if (preprocessor_internal_lexer(state) != TOKEN_INT_LITERAL)
if (preprocessor_lexer(state) != TOKEN_INT_LITERAL)
bogus = 1;
else
{
Expand All @@ -774,7 +774,7 @@ static void handle_pp_line(Context *ctx)
} // else

if (!bogus)
bogus = (preprocessor_internal_lexer(state) != TOKEN_STRING_LITERAL);
bogus = (preprocessor_lexer(state) != TOKEN_STRING_LITERAL);

if (!bogus)
{
Expand Down Expand Up @@ -819,7 +819,7 @@ static void handle_pp_error(Context *ctx)
{
bytes_left = state->bytes_left;
source = state->source;
const Token token = preprocessor_internal_lexer(state);
const Token token = preprocessor_lexer(state);
switch (token)
{
case ((Token) '\n'):
Expand Down Expand Up @@ -859,7 +859,7 @@ static void handle_pp_define(Context *ctx)
{
IncludeState *state = ctx->include_stack;

if (preprocessor_internal_lexer(state) != TOKEN_IDENTIFIER)
if (preprocessor_lexer(state) != TOKEN_IDENTIFIER)
{
fail(ctx, "Macro names must be indentifiers");
return;
Expand All @@ -883,7 +883,7 @@ static void handle_pp_define(Context *ctx)
{
bytes_left = state->bytes_left;
source = state->source;
const Token token = preprocessor_internal_lexer(state);
const Token token = preprocessor_lexer(state);
switch (token)
{
case TOKEN_INCOMPLETE_COMMENT:
Expand Down Expand Up @@ -932,7 +932,7 @@ static void handle_pp_undef(Context *ctx)
{
IncludeState *state = ctx->include_stack;

if (preprocessor_internal_lexer(state) != TOKEN_IDENTIFIER)
if (preprocessor_lexer(state) != TOKEN_IDENTIFIER)
{
fail(ctx, "Macro names must be indentifiers");
return;
Expand All @@ -958,7 +958,7 @@ static Conditional *_handle_pp_ifdef(Context *ctx, const Token type)

assert((type == TOKEN_PP_IFDEF) || (type == TOKEN_PP_IFNDEF));

if (preprocessor_internal_lexer(state) != TOKEN_IDENTIFIER)
if (preprocessor_lexer(state) != TOKEN_IDENTIFIER)
{
fail(ctx, "Macro names must be indentifiers");
return NULL;
Expand Down Expand Up @@ -1127,7 +1127,7 @@ static inline const char *_preprocessor_nexttoken(Preprocessor *_ctx,
const Conditional *cond = state->conditional_stack;
const int skipping = ((cond != NULL) && (cond->skipping));

Token token = preprocessor_internal_lexer(state);
Token token = preprocessor_lexer(state);
if (token == TOKEN_EOI)
{
assert(state->bytes_left == 0);
Expand Down

0 comments on commit a818d5e

Please sign in to comment.