| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
* src/paca.mjs (numFromDigits): Move it to before the *StateStep
functions, as it is now used in `rangeStateStep()` function. So
instead of letting it be defined afters its usage, move it up.
* tests/paca.mjs: Do the same hoisting to the import of the
`numFromDigits` name, to the definition of `test_numFromDigits` and
its inclusion in the order of the call to `runTests()`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introducing "[" now we will start to write the code to parse the
character class expressions, i.e. [a-z0-9]. The `context` key will
contain a `set` with all the literal characters that were found, and all
the ranges too. For parsing the ranges, a `range` key equivalent to the
one for the {m,n} range is used. Despite the superficial syntax being
simmilar, its logic, semantic and implementation will be different.
* src/paca.mjs (TRANSITION_FNS) <"[">: Add new transition function for
handling the start of a character class expression.
* tests/paca.mjs (TRANSITION_FNS): Add a singular test entry, that
exercises the conditionless body of the function.
|
| |
|
|
|
|
|
|
|
|
| |
* src/paca.mjs (TRANSITION_FNS): Add trailing underscore to ignored
arguments, even though it breaks the name of the `_state` and
`context` destructuring arguments.
* tests/paca.mjs (test_TRANSITION_FNS): Add new test function with a
single case for each transition character. Since these transitions
are unconditional and contain no logic, this single sample test is
enough to cover for all of its behaviour.
|
| |
|
|
| |
This reverts commit 15f206e4940cb80ff98eea7c376d9c618f80ed0e.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
When handling a custom state, dispatch it to the appropriate function in
`STATE_FNS`; and when looking for chars that enters these custom states,
dispatch it to the appropriate function in `TRANSITION_FNS`.
The body of each part didn't change, so no tests had to be modified.
But now we can write specific tests for each case, and remove the bulk
of the logic out of `tokenizeRegexFn()`.
|
| | |
|
| |
|
|
| |
singleton array
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|