aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2022-01-07 17:51:12 +0530
committerAkshay Nair <phenax5@gmail.com>2022-01-07 17:52:33 +0530
commitb3fc08cae05f997e71d846109d400e630b8a4c35 (patch)
treee3bf0ab1836aade74593123e978fe49b9a09b7df /tests
parentad8983655dc35b5401e810a9d4b61e933d35b783 (diff)
downloadelxr-b3fc08cae05f997e71d846109d400e630b8a4c35.tar.gz
elxr-b3fc08cae05f997e71d846109d400e630b8a4c35.zip
feat: adds quantifier suffix parsing + recoverInput for combinators
Diffstat (limited to 'tests')
-rw-r--r--tests/basic.spec.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basic.spec.ts b/tests/basic.spec.ts
index b0a4d50..4e0a938 100644
--- a/tests/basic.spec.ts
+++ b/tests/basic.spec.ts
@@ -45,5 +45,18 @@ describe('Foobar', () => {
],
''
]))
+
+ expect(parser(/^ \s* \T? \n+ $/.source)).toEqual(right([
+ [
+ some({ tag: 'Start' }),
+ [
+ { tag: 'ZeroOrMore', expr: { tag: 'AnyString' } },
+ { tag: 'Optional', expr: { tag: 'Truthy' } },
+ { tag: 'OneOrMore', expr: { tag: 'AnyNumber' } },
+ ],
+ some({ tag: 'End' }),
+ ],
+ ''
+ ]))
})
})