X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=lexer.c;h=1300b3d26f23cda1c90093658115266e03a941ab;hb=353985d8d06fcac2f36682820b8ae635c5e6162e;hp=69959ef063f4047acf8ae82a3acb7c4fe4781e7e;hpb=c5930eba0b375e52de3b477dcf3540636701774b;p=cparser 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';