Changes in src/Parser/lex.ll [c1c1112:f487962]
- File:
-
- 1 edited
-
src/Parser/lex.ll (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
rc1c1112 rf487962 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Aug 24 13:27:04201613 * Update Count : 4 8712 * Last Modified On : Thu Aug 18 22:17:30 2016 13 * Update Count : 472 14 14 */ 15 15 … … 141 141 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" { 142 142 /* " stop highlighting */ 143 static char filename[FILENAME_MAX];// temporarily store current source-file name143 static char *filename[FILENAME_MAX]; // temporarily store current source-file name 144 144 char *end_num; 145 145 char *begin_string, *end_string; … … 156 156 //std::cout << "file " << filename << " line " << lineno << std::endl; 157 157 yylineno = lineno; 158 yyfilename = filename ;158 yyfilename = filename[0]; 159 159 } // if 160 160 } … … 288 288 289 289 /* character constant, allows empty value */ 290 ({cwide_prefix}[_]?)?['] { BEGIN QUOTE; rm_underscore(); strtext = new std::string ( yytext, yyleng); }291 <QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng); }292 <QUOTE>['\n] { BEGIN 0; strtext->append( yytext, yyleng); RETURN_STR(CHARACTERconstant); }290 ({cwide_prefix}[_]?)?['] { BEGIN QUOTE; rm_underscore(); strtext = new std::string; *strtext += std::string( yytext ); } 291 <QUOTE>[^'\\\n]* { *strtext += std::string( yytext ); } 292 <QUOTE>['\n] { BEGIN 0; *strtext += std::string( yytext); RETURN_STR(CHARACTERconstant); } 293 293 /* ' stop highlighting */ 294 294 295 295 /* string constant */ 296 ({swide_prefix}[_]?)?["] { BEGIN STRING; rm_underscore(); strtext = new std::string ( yytext, yyleng); }297 <STRING>[^"\\\n]* { strtext->append( yytext, yyleng); }298 <STRING>["\n] { BEGIN 0; strtext->append( yytext, yyleng); RETURN_STR(STRINGliteral); }296 ({swide_prefix}[_]?)?["] { BEGIN STRING; rm_underscore(); strtext = new std::string; *strtext += std::string( yytext ); } 297 <STRING>[^"\\\n]* { *strtext += std::string( yytext ); } 298 <STRING>["\n] { BEGIN 0; *strtext += std::string( yytext ); RETURN_STR(STRINGliteral); } 299 299 /* " stop highlighting */ 300 300 301 301 /* common character/string constant */ 302 <QUOTE,STRING>{escape_seq} { rm_underscore(); strtext->append( yytext, yyleng); }302 <QUOTE,STRING>{escape_seq} { rm_underscore(); *strtext += std::string( yytext ); } 303 303 <QUOTE,STRING>"\\"{h_white}*"\n" {} // continuation (ALSO HANDLED BY CPP) 304 <QUOTE,STRING>"\\" { strtext->append( yytext, yyleng); } // unknown escape character304 <QUOTE,STRING>"\\" { *strtext += std::string( yytext ); } // unknown escape character 305 305 306 306 /* punctuation */
Note:
See TracChangeset
for help on using the changeset viewer.