From a818d5ee1c777600e4a1c1f47c093981be72c258 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 18 Feb 2009 08:29:48 -0500 Subject: [PATCH] Renamed preprocessor_internal_lexer to preprocessor_lexer. --- mojoshader_internal.h | 2 +- mojoshader_lexer.c | 4 ++-- mojoshader_lexer.re | 4 ++-- mojoshader_preprocessor.c | 28 ++++++++++++++-------------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/mojoshader_internal.h b/mojoshader_internal.h index ae9cdd4a..0c139475 100644 --- a/mojoshader_internal.h +++ b/mojoshader_internal.h @@ -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. diff --git a/mojoshader_lexer.c b/mojoshader_lexer.c index 95761b33..959044fe 100644 --- a/mojoshader_lexer.c +++ b/mojoshader_lexer.c @@ -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; @@ -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) ... diff --git a/mojoshader_lexer.re b/mojoshader_lexer.re index 9a9510ef..334b6e06 100644 --- a/mojoshader_lexer.re +++ b/mojoshader_lexer.re @@ -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; @@ -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) ... diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index fe8bd408..bdaffe4f 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -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 @@ -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; @@ -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; @@ -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 { @@ -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) { @@ -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'): @@ -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; @@ -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: @@ -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; @@ -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; @@ -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);