X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=lexer.c;h=1300b3d26f23cda1c90093658115266e03a941ab;hb=22420f9404b76d3ab2536c7d3903cbcf05a792a8;hp=9ff748a32867c3fa67c8a18de7bd7a42f2531c40;hpb=35b6bfa9d3d3cbaa12c753901d53751a3ea7c0af;p=cparser diff --git a/lexer.c b/lexer.c index 9ff748a..1300b3d 100644 --- a/lexer.c +++ b/lexer.c @@ -17,6 +17,7 @@ static int c; token_t lexer_token; +symbol_t *symbol_L; static FILE *input; static char buf[1024 + MAX_PUTBACK]; static const char *bufend; @@ -804,7 +805,7 @@ static void parse_preprocessor_identifier(void) } } -static void parse_preprocessor_directive() +static void parse_preprocessor_directive(void) { next_pp_token(); @@ -862,6 +863,12 @@ void lexer_next_preprocessing_token(void) SYMBOL_CHARS parse_symbol(); + /* might be a wide string ( L"string" ) */ + if(c == '"' && (lexer_token.type == T_IDENTIFIER && + lexer_token.v.symbol == symbol_L)) { + parse_string_literal(); + return; + } return; DIGITS @@ -1040,6 +1047,8 @@ void lexer_open_stream(FILE *stream, const char *input_name) lexer_token.source_position.linenr = 0; lexer_token.source_position.input_name = input_name; + symbol_L = symbol_table_insert("L"); + /* place a virtual \n at the beginning so the lexer knows that we're * at the beginning of a line */ c = '\n';