@@ -765,12 +765,18 @@ with noyywrap then we can remove this pragma.
765
765
#define snprintf _snprintf
766
766
#endif
767
767
768
+ // Bitmap with 1 bit for each of the 256 characters in the ASCII table. The bit
769
+ // is set to 1 if the corresponding character is alphanumeric or 0 if otherwise.
768
770
static uint8_t word_chars [] = {
769
771
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xFF , 0x03 ,
770
772
0xFE , 0xFF , 0xFF , 0x87 , 0xFE , 0xFF , 0xFF , 0x07 ,
771
773
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
772
774
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
773
775
776
+ // Bitmap with 1 bit for each of the 256 characters in the ASCII table. The bit
777
+ // is set to 1 if the corresponding character is considered a space. Space
778
+ // characters include horizontal and vertical tabs, carriage return, new line
779
+ // and form feed (\t, \v, \r, \n, \f).
774
780
static uint8_t space_chars [] = {
775
781
0x00 , 0x3E , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
776
782
0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
@@ -785,10 +791,10 @@ int read_escaped_char(
785
791
yyscan_t yyscanner ,
786
792
uint8_t * escaped_char );
787
793
788
- #line 788 "re_lexer.c"
794
+ #line 794 "re_lexer.c"
789
795
#define YY_NO_UNISTD_H 1
790
796
791
- #line 791 "re_lexer.c"
797
+ #line 797 "re_lexer.c"
792
798
793
799
#define INITIAL 0
794
800
#define char_class 1
@@ -1061,10 +1067,10 @@ YY_DECL
1061
1067
}
1062
1068
1063
1069
{
1064
- #line 105 "re_lexer.l"
1070
+ #line 111 "re_lexer.l"
1065
1071
1066
1072
1067
- #line 1067 "re_lexer.c"
1073
+ #line 1073 "re_lexer.c"
1068
1074
1069
1075
while ( /*CONSTCOND*/ 1 ) /* loops until end-of-file is reached */
1070
1076
{
@@ -1131,7 +1137,7 @@ YY_DECL
1131
1137
1132
1138
case 1 :
1133
1139
YY_RULE_SETUP
1134
- #line 107 "re_lexer.l"
1140
+ #line 113 "re_lexer.l"
1135
1141
{
1136
1142
1137
1143
// Examples: {3,8} {0,5} {,5} {7,}
@@ -1173,7 +1179,7 @@ YY_RULE_SETUP
1173
1179
YY_BREAK
1174
1180
case 2 :
1175
1181
YY_RULE_SETUP
1176
- #line 147 "re_lexer.l"
1182
+ #line 153 "re_lexer.l"
1177
1183
{
1178
1184
1179
1185
// Example: {10}
@@ -1202,7 +1208,7 @@ YY_RULE_SETUP
1202
1208
YY_BREAK
1203
1209
case 3 :
1204
1210
YY_RULE_SETUP
1205
- #line 174 "re_lexer.l"
1211
+ #line 180 "re_lexer.l"
1206
1212
{
1207
1213
1208
1214
// Start of a negated character class. Example: [^abcd]
@@ -1214,7 +1220,7 @@ YY_RULE_SETUP
1214
1220
YY_BREAK
1215
1221
case 4 :
1216
1222
YY_RULE_SETUP
1217
- #line 183 "re_lexer.l"
1223
+ #line 189 "re_lexer.l"
1218
1224
{
1219
1225
1220
1226
// Start of character negated class containing a ].
@@ -1229,7 +1235,7 @@ YY_RULE_SETUP
1229
1235
YY_BREAK
1230
1236
case 5 :
1231
1237
YY_RULE_SETUP
1232
- #line 196 "re_lexer.l"
1238
+ #line 202 "re_lexer.l"
1233
1239
{
1234
1240
1235
1241
// Start of character class containing a ].
@@ -1244,7 +1250,7 @@ YY_RULE_SETUP
1244
1250
YY_BREAK
1245
1251
case 6 :
1246
1252
YY_RULE_SETUP
1247
- #line 209 "re_lexer.l"
1253
+ #line 215 "re_lexer.l"
1248
1254
{
1249
1255
1250
1256
// Start of character class. Example: [abcd]
@@ -1257,7 +1263,7 @@ YY_RULE_SETUP
1257
1263
case 7 :
1258
1264
/* rule 7 can match eol */
1259
1265
YY_RULE_SETUP
1260
- #line 219 "re_lexer.l"
1266
+ #line 225 "re_lexer.l"
1261
1267
{
1262
1268
1263
1269
// Any non-special character is passed as a CHAR token to the scanner.
@@ -1268,63 +1274,63 @@ YY_RULE_SETUP
1268
1274
YY_BREAK
1269
1275
case 8 :
1270
1276
YY_RULE_SETUP
1271
- #line 228 "re_lexer.l"
1277
+ #line 234 "re_lexer.l"
1272
1278
{
1273
1279
return _WORD_CHAR_ ;
1274
1280
}
1275
1281
YY_BREAK
1276
1282
case 9 :
1277
1283
YY_RULE_SETUP
1278
- #line 233 "re_lexer.l"
1284
+ #line 239 "re_lexer.l"
1279
1285
{
1280
1286
return _NON_WORD_CHAR_ ;
1281
1287
}
1282
1288
YY_BREAK
1283
1289
case 10 :
1284
1290
YY_RULE_SETUP
1285
- #line 238 "re_lexer.l"
1291
+ #line 244 "re_lexer.l"
1286
1292
{
1287
1293
return _SPACE_ ;
1288
1294
}
1289
1295
YY_BREAK
1290
1296
case 11 :
1291
1297
YY_RULE_SETUP
1292
- #line 243 "re_lexer.l"
1298
+ #line 249 "re_lexer.l"
1293
1299
{
1294
1300
return _NON_SPACE_ ;
1295
1301
}
1296
1302
YY_BREAK
1297
1303
case 12 :
1298
1304
YY_RULE_SETUP
1299
- #line 248 "re_lexer.l"
1305
+ #line 254 "re_lexer.l"
1300
1306
{
1301
1307
return _DIGIT_ ;
1302
1308
}
1303
1309
YY_BREAK
1304
1310
case 13 :
1305
1311
YY_RULE_SETUP
1306
- #line 253 "re_lexer.l"
1312
+ #line 259 "re_lexer.l"
1307
1313
{
1308
1314
return _NON_DIGIT_ ;
1309
1315
}
1310
1316
YY_BREAK
1311
1317
case 14 :
1312
1318
YY_RULE_SETUP
1313
- #line 258 "re_lexer.l"
1319
+ #line 264 "re_lexer.l"
1314
1320
{
1315
1321
return _WORD_BOUNDARY_ ;
1316
1322
}
1317
1323
YY_BREAK
1318
1324
case 15 :
1319
1325
YY_RULE_SETUP
1320
- #line 262 "re_lexer.l"
1326
+ #line 268 "re_lexer.l"
1321
1327
{
1322
1328
return _NON_WORD_BOUNDARY_ ;
1323
1329
}
1324
1330
YY_BREAK
1325
1331
case 16 :
1326
1332
YY_RULE_SETUP
1327
- #line 267 "re_lexer.l"
1333
+ #line 273 "re_lexer.l"
1328
1334
{
1329
1335
1330
1336
yyerror (yyscanner , lex_env , "backreferences are not allowed" );
@@ -1333,7 +1339,7 @@ YY_RULE_SETUP
1333
1339
YY_BREAK
1334
1340
case 17 :
1335
1341
YY_RULE_SETUP
1336
- #line 274 "re_lexer.l"
1342
+ #line 280 "re_lexer.l"
1337
1343
{
1338
1344
1339
1345
uint8_t c ;
@@ -1352,7 +1358,7 @@ YY_RULE_SETUP
1352
1358
YY_BREAK
1353
1359
case 18 :
1354
1360
YY_RULE_SETUP
1355
- #line 291 "re_lexer.l"
1361
+ #line 297 "re_lexer.l"
1356
1362
{
1357
1363
1358
1364
// End of character class.
@@ -1368,7 +1374,7 @@ YY_RULE_SETUP
1368
1374
case 19 :
1369
1375
/* rule 19 can match eol */
1370
1376
YY_RULE_SETUP
1371
- #line 305 "re_lexer.l"
1377
+ #line 311 "re_lexer.l"
1372
1378
{
1373
1379
1374
1380
// A range inside a character class.
@@ -1416,7 +1422,7 @@ YY_RULE_SETUP
1416
1422
YY_BREAK
1417
1423
case 20 :
1418
1424
YY_RULE_SETUP
1419
- #line 351 "re_lexer.l"
1425
+ #line 357 "re_lexer.l"
1420
1426
{
1421
1427
1422
1428
int i ;
@@ -1427,7 +1433,7 @@ YY_RULE_SETUP
1427
1433
YY_BREAK
1428
1434
case 21 :
1429
1435
YY_RULE_SETUP
1430
- #line 360 "re_lexer.l"
1436
+ #line 366 "re_lexer.l"
1431
1437
{
1432
1438
1433
1439
int i ;
@@ -1438,7 +1444,7 @@ YY_RULE_SETUP
1438
1444
YY_BREAK
1439
1445
case 22 :
1440
1446
YY_RULE_SETUP
1441
- #line 369 "re_lexer.l"
1447
+ #line 375 "re_lexer.l"
1442
1448
{
1443
1449
1444
1450
int i ;
@@ -1449,7 +1455,7 @@ YY_RULE_SETUP
1449
1455
YY_BREAK
1450
1456
case 23 :
1451
1457
YY_RULE_SETUP
1452
- #line 378 "re_lexer.l"
1458
+ #line 384 "re_lexer.l"
1453
1459
{
1454
1460
1455
1461
int i ;
@@ -1460,7 +1466,7 @@ YY_RULE_SETUP
1460
1466
YY_BREAK
1461
1467
case 24 :
1462
1468
YY_RULE_SETUP
1463
- #line 387 "re_lexer.l"
1469
+ #line 393 "re_lexer.l"
1464
1470
{
1465
1471
1466
1472
char c ;
@@ -1471,7 +1477,7 @@ YY_RULE_SETUP
1471
1477
YY_BREAK
1472
1478
case 25 :
1473
1479
YY_RULE_SETUP
1474
- #line 396 "re_lexer.l"
1480
+ #line 402 "re_lexer.l"
1475
1481
{
1476
1482
1477
1483
int i ;
@@ -1493,7 +1499,7 @@ YY_RULE_SETUP
1493
1499
YY_BREAK
1494
1500
case 26 :
1495
1501
YY_RULE_SETUP
1496
- #line 416 "re_lexer.l"
1502
+ #line 422 "re_lexer.l"
1497
1503
{
1498
1504
1499
1505
uint8_t c ;
@@ -1511,7 +1517,7 @@ YY_RULE_SETUP
1511
1517
YY_BREAK
1512
1518
case 27 :
1513
1519
YY_RULE_SETUP
1514
- #line 432 "re_lexer.l"
1520
+ #line 438 "re_lexer.l"
1515
1521
{
1516
1522
1517
1523
if (yytext [0 ] >= 32 && yytext [0 ] < 127 )
@@ -1529,7 +1535,7 @@ YY_RULE_SETUP
1529
1535
}
1530
1536
YY_BREAK
1531
1537
case YY_STATE_EOF (char_class ):
1532
- #line 449 "re_lexer.l"
1538
+ #line 455 "re_lexer.l"
1533
1539
{
1534
1540
1535
1541
// End of regexp reached while scanning a character class.
@@ -1540,7 +1546,7 @@ case YY_STATE_EOF(char_class):
1540
1546
YY_BREAK
1541
1547
case 28 :
1542
1548
YY_RULE_SETUP
1543
- #line 458 "re_lexer.l"
1549
+ #line 464 "re_lexer.l"
1544
1550
{
1545
1551
1546
1552
if (yytext [0 ] >= 32 && yytext [0 ] < 127 )
@@ -1555,18 +1561,18 @@ YY_RULE_SETUP
1555
1561
}
1556
1562
YY_BREAK
1557
1563
case YY_STATE_EOF (INITIAL ):
1558
- #line 472 "re_lexer.l"
1564
+ #line 478 "re_lexer.l"
1559
1565
{
1560
1566
1561
1567
yyterminate ();
1562
1568
}
1563
1569
YY_BREAK
1564
1570
case 29 :
1565
1571
YY_RULE_SETUP
1566
- #line 477 "re_lexer.l"
1572
+ #line 483 "re_lexer.l"
1567
1573
ECHO ;
1568
1574
YY_BREAK
1569
- #line 1569 "re_lexer.c"
1575
+ #line 1575 "re_lexer.c"
1570
1576
1571
1577
case YY_END_OF_BUFFER :
1572
1578
{
@@ -2715,7 +2721,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
2715
2721
2716
2722
#define YYTABLES_NAME "yytables"
2717
2723
2718
- #line 477 "re_lexer.l"
2724
+ #line 483 "re_lexer.l"
2719
2725
2720
2726
2721
2727
int escaped_char_value (
0 commit comments