- Notifications
You must be signed in to change notification settings - Fork5
Commitc6aae30
committed
Simplify and document regex library's compact-NFA representation.
The previous coding abused the first element of a cNFA state's arcs listto hold a per-state flag bit, which was confusing, undocumented, and noteven particularly efficient. Get rid of that in favor of a separate"stflags" vector. Since there's only one bit in use, I chose to allocate achar per state; we could possibly replace this with a bitmap at some point,but that would make accesses a little slower. It's already about 8Xsmaller than before, so let's not get overly tense.Also document the representation better than it was before, which is to saynot at all.This patch is a byproduct of investigations towards extracting a "fixedprefix" string from the compact-NFA representation of regex patterns.Might need to back-patch it if we decide to back-patch that fix, but fornow it's just code cleanup so I'll just put it in HEAD.1 parenta184e4d commitc6aae30
File tree
4 files changed
+44
-32
lines changed- src
- backend/regex
- include/regex
4 files changed
+44
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | | - | |
1334 | | - | |
| 1333 | + | |
1335 | 1334 | | |
1336 | 1335 | | |
| 1336 | + | |
1337 | 1337 | | |
1338 | 1338 | | |
1339 | | - | |
| 1339 | + | |
1340 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
1341 | 1343 | | |
1342 | 1344 | | |
1343 | 1345 | | |
| |||
1359 | 1361 | | |
1360 | 1362 | | |
1361 | 1363 | | |
| 1364 | + | |
1362 | 1365 | | |
1363 | | - | |
1364 | | - | |
1365 | 1366 | | |
1366 | 1367 | | |
1367 | 1368 | | |
| |||
1392 | 1393 | | |
1393 | 1394 | | |
1394 | 1395 | | |
1395 | | - | |
1396 | | - | |
| 1396 | + | |
| 1397 | + | |
1397 | 1398 | | |
1398 | 1399 | | |
1399 | 1400 | | |
| |||
1433 | 1434 | | |
1434 | 1435 | | |
1435 | 1436 | | |
| 1437 | + | |
1436 | 1438 | | |
1437 | 1439 | | |
1438 | 1440 | | |
| |||
1617 | 1619 | | |
1618 | 1620 | | |
1619 | 1621 | | |
1620 | | - | |
| 1622 | + | |
1621 | 1623 | | |
1622 | 1624 | | |
1623 | 1625 | | |
| |||
1629 | 1631 | | |
1630 | 1632 | | |
1631 | 1633 | | |
1632 | | - | |
1633 | 1634 | | |
1634 | 1635 | | |
1635 | 1636 | | |
1636 | | - | |
| 1637 | + | |
1637 | 1638 | | |
1638 | 1639 | | |
1639 | | - | |
| 1640 | + | |
1640 | 1641 | | |
1641 | | - | |
| 1642 | + | |
1642 | 1643 | | |
1643 | | - | |
1644 | | - | |
| 1644 | + | |
| 1645 | + | |
1645 | 1646 | | |
1646 | | - | |
1647 | | - | |
| 1647 | + | |
1648 | 1648 | | |
1649 | 1649 | | |
1650 | 1650 | | |
| |||
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
1656 | | - | |
| 1656 | + | |
1657 | 1657 | | |
1658 | 1658 | | |
1659 | 1659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
479 | | - | |
| 478 | + | |
480 | 479 | | |
481 | | - | |
| 480 | + | |
482 | 481 | | |
483 | 482 | | |
484 | 483 | | |
| |||
489 | 488 | | |
490 | 489 | | |
491 | 490 | | |
492 | | - | |
| 491 | + | |
493 | 492 | | |
494 | 493 | | |
495 | 494 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
| 282 | + | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | | - | |
| 286 | + | |
288 | 287 | | |
289 | | - | |
290 | | - | |
| 288 | + | |
| 289 | + | |
291 | 290 | | |
292 | 291 | | |
293 | 292 | | |
| |||
339 | 338 | | |
340 | 339 | | |
341 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
342 | 352 | | |
343 | 353 | | |
344 | 354 | | |
345 | 355 | | |
346 | | - | |
| 356 | + | |
347 | 357 | | |
348 | 358 | | |
349 | 359 | | |
350 | 360 | | |
351 | 361 | | |
352 | | - | |
| 362 | + | |
353 | 363 | | |
354 | | - | |
| 364 | + | |
355 | 365 | | |
356 | 366 | | |
357 | 367 | | |
358 | 368 | | |
| 369 | + | |
| 370 | + | |
359 | 371 | | |
| 372 | + | |
360 | 373 | | |
361 | 374 | | |
362 | 375 | | |
| |||
0 commit comments
Comments
(0)