Skip to content

Commit 7a8e9d3

Browse files
committed
Introduce c++23 feature flag and condition size_t literals with it
1 parent 2408633 commit 7a8e9d3

File tree

17 files changed

+1319
-1338
lines changed

17 files changed

+1319
-1338
lines changed

include/boost/wave/cpplexer/re2clex/cpp.re

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -492,30 +492,34 @@ pp_number:
492492
/* this subscanner is called, whenever an Integer was recognized */
493493
integer_suffix:
494494
{
495-
if (s->enable_ms_extensions) {
496-
/*!re2c
497-
LongIntegerSuffix | MSLongIntegerSuffix
498-
{ BOOST_WAVE_RET(T_LONGINTLIT); }
495+
auto suffix_start = YYCURSOR;
499496
500-
SizeTSuffix
501-
{ BOOST_WAVE_RET(T_SIZETLIT); }
497+
/*!re2c
498+
LongIntegerSuffix
499+
{ BOOST_WAVE_RET(T_LONGINTLIT); }
500+
501+
MSLongIntegerSuffix {
502+
if (s->enable_ms_extensions) {
503+
BOOST_WAVE_RET(T_LONGINTLIT);
504+
} else {
505+
YYCURSOR = suffix_start;
506+
BOOST_WAVE_RET(T_INTLIT);
507+
}
508+
}
502509
503-
IntegerSuffix?
504-
{ BOOST_WAVE_RET(T_INTLIT); }
505-
*/
510+
SizeTSuffix {
511+
if (s->act_in_cpp2b_mode) {
512+
BOOST_WAVE_RET(T_SIZETLIT);
513+
} else {
514+
YYCURSOR = suffix_start;
515+
BOOST_WAVE_RET(T_INTLIT);
516+
}
506517
}
507-
else {
508-
/*!re2c
509-
LongIntegerSuffix
510-
{ BOOST_WAVE_RET(T_LONGINTLIT); }
511518
512-
SizeTSuffix
513-
{ BOOST_WAVE_RET(T_SIZETLIT); }
519+
IntegerSuffix?
520+
{ BOOST_WAVE_RET(T_INTLIT); }
514521
515-
IntegerSuffix?
516-
{ BOOST_WAVE_RET(T_INTLIT); }
517522
*/
518-
}
519523
520524
// re2c will complain about -Wmatch-empty-string above
521525
// it's OK because we've already matched an integer

0 commit comments

Comments
 (0)