From a9c17bbc7a863b3dd3c0bfdd8884c0d8b274cb0d Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Mon, 12 Nov 2007 19:48:05 +0000 Subject: [PATCH] parse wide strings [r18378] --- lexer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lexer.c b/lexer.c index 69959ef..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; @@ -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'; -- 2.20.1