diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-01-14 21:15:19 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-01-14 21:15:19 +0530 |
| commit | 3b0e7428441f85de5e76a59abbb09931bcf2387b (patch) | |
| tree | 093b71f4ec86c77ca9741526499e119cad38387f /tests | |
| parent | 920038de1945298e5a693cc11fd97a73e48b9bc8 (diff) | |
| download | elxr-3b0e7428441f85de5e76a59abbb09931bcf2387b.tar.gz elxr-3b0e7428441f85de5e76a59abbb09931bcf2387b.zip | |
feat: implements manyTill parser combinator
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/parser.spec.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/parser.spec.ts b/tests/parser.spec.ts index 0abb1a0..0506be0 100644 --- a/tests/parser.spec.ts +++ b/tests/parser.spec.ts @@ -4,10 +4,17 @@ import { whitespace, whitespaces0, delimited, + not, + symbol, + satifyChar, + matchChar, + manyTill, + pair, } from '../src/parser/utils' import { parser } from '../src/parser' import { none, some } from 'fp-ts/Option' import { Expr, Literal } from '../src/types' +import {jlog} from '../src/utils' const wrap = (e: Expr) => right([[none, e, none], '']) const grouped = (l: Expr[]) => wrap(Expr.Group({ exprs: l })) @@ -16,6 +23,8 @@ const groupedAlt = (l: Expr[]) => wrap(Expr.Or({ exprs: l })) describe('Parser', () => { it('should do shit', () => { // jlog(parser(/ -2.05|\n2|true|\s|\T /.source)) + //const p = pair(symbol('a'), symbol('b')) + //jlog(manyTill(p, matchChar('!'))('ab ab ab ab! nice nice')) }) it('should do shit', () => { |
