summaryrefslogtreecommitdiff
path: root/src/paca.mjs
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-07-13 19:58:06 -0300
committerEuAndreh <eu@euandre.org>2025-07-13 19:58:10 -0300
commita4873cddb17d24d9a2d10b1aa704cedc021350f9 (patch)
tree4d0409b0281656a595d858fb82fbebe547d65ca6 /src/paca.mjs
parentRevert "src/paca.mjs: Temporarily export internal functions" (diff)
downloadpaca-a4873cddb17d24d9a2d10b1aa704cedc021350f9.tar.gz
paca-a4873cddb17d24d9a2d10b1aa704cedc021350f9.tar.xz
Add simple test for TRANSITION_FNS
* 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.
Diffstat (limited to 'src/paca.mjs')
-rw-r--r--src/paca.mjs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/paca.mjs b/src/paca.mjs
index e8ec542..c1bead1 100644
--- a/src/paca.mjs
+++ b/src/paca.mjs
@@ -107,12 +107,12 @@ const STATE_FNS = {
};
const TRANSITION_FNS = {
- "\\": ({ out, state, context }, char, index, next) => ({
+ "\\": ({ out, _state, context }, _char, _index, _next) => ({
out,
state: ConcatStep.ESCAPING,
context,
}),
- "{": ({ out, state, context }, char, index, next) => ({
+ "{": ({ out, _state, _context }, _char, _index, _next) => ({
out,
state: ConcatStep.RANGE,
context: {