- Timestamp:
- Oct 13, 2024, 4:59:53 PM (2 months ago)
- Branches:
- master
- Children:
- 02ea981
- Parents:
- c565d68
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
rc565d68 r4e0168a 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sun Oct 13 1 0:03:28202413 * Update Count : 8 6912 * Last Modified On : Sun Oct 13 16:49:47 2024 13 * Update Count : 876 14 14 */ 15 15 … … 175 175 // operator {op_unary_pre_post}|{op_binary_over}|{op_binary_not_over} 176 176 177 // C23 attributes 178 attr_string "\"" [^\"]*"\""179 attr_arg_opt ({hv_white}*"(" {hv_white}*{attr_string}{hv_white}*")")?177 // C23 attributes, CPP also handles missing quote delimiter 178 attr_string "\""([^\"\\\n]|{escape_seq})*["\n] 179 attr_arg_opt ({hv_white}*"("({hv_white}*{attr_string}{hv_white}*)+")")? 180 180 attributes "deprecated"{attr_arg_opt}|"fallthrough"|"nodiscard"{attr_arg_opt}|"maybe_unused"|"noreturn"|"_Noreturn"|"unsequenced"|"unused"|"reproducible"|{identifier}{hv_white}*"::"{hv_white}*{identifier} 181 181 182 182 %x COMMENT 183 %x BKQUOTE184 183 %x QUOTE 185 184 %x STRING … … 382 381 /* C23 attributes */ 383 382 "[["{hv_white}*{attributes}({hv_white}*","{hv_white}*{attributes})*{hv_white}*"]]" { 384 strtext = new string( &yytext[2], yyleng - 4 ); // remove [[]]383 strtext = new string( &yytext[2], yyleng - 4 ); // remove delimiters "[[" and "]]" 385 384 RETURN_STR(C23_ATTRIBUTE); 386 385 } … … 396 395 {hex_floating_constant} { NUMERIC_RETURN(FLOATINGconstant); } 397 396 398 /* character constant, allows empty value */397 /* character constant, allows empty value, CPP also handles missing quote delimiter */ 399 398 ({cwide_prefix}[_]?)?['] { BEGIN QUOTE; rm_underscore(); strtext = new string( yytext, yyleng ); } 400 399 <QUOTE>[^'\\\n]* { strtext->append( yytext, yyleng ); } … … 402 401 /* ' stop editor highlighting */ 403 402 404 /* string constant */403 /* string constant, CPP also handles missing quote delimiter */ 405 404 ({swide_prefix}[_]?)?["] { BEGIN STRING; rm_underscore(); strtext = new string( yytext, yyleng ); } 406 405 <STRING>[^"\\\n]* { strtext->append( yytext, yyleng ); }
Note: See TracChangeset
for help on using the changeset viewer.