Skip to content

Commit

Permalink
Lexer now handles '\\' continuation at the end of a line.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 15, 2009
1 parent 3fb7c25 commit 378e88d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions mojoshader_lexer.re
Expand Up @@ -69,6 +69,8 @@ scanner_loop:
*/

/*!re2c
"\\" [ \t\v\f]* NEWLINE { s->line++; goto scanner_loop; }
"/*" { goto multilinecomment; }
"//" { goto singlelinecomment; }
Expand All @@ -83,7 +85,7 @@ scanner_loop:
(["] (ESC|ANY\[\r\n\\"])* ["])
{ RET(TOKEN_STRING_LITERAL); }
">>=" { RET(TOKEN_RSHIFTASSIGN); }
"<<=" { RET(TOKEN_LSHIFTASSIGN); }
"+=" { RET(TOKEN_ADDASSIGN); }
Expand Down Expand Up @@ -129,7 +131,6 @@ scanner_loop:
"}" { RET('}'); }
"=" { RET('='); }
"?" { RET('?'); }
"\\" { RET('\\'); }
PP "include" { RET(TOKEN_PP_INCLUDE); }
PP "line" { RET(TOKEN_PP_LINE); }
Expand Down
4 changes: 0 additions & 4 deletions mojoshader_preprocessor.c
Expand Up @@ -568,10 +568,6 @@ int preprocessor_outofmemory(Preprocessor *_ctx)
} // preprocessor_outofmemory


// !!! FIXME: (almost?) all preprocessor directives can end a line with a
// !!! FIXME: '\\' to continue to the next line.


static int require_newline(IncludeState *state)
{
const char *source = state->source;
Expand Down

0 comments on commit 378e88d

Please sign in to comment.