aboutsummaryrefslogtreecommitdiff
path: root/src/types.ts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2022-01-07 18:13:40 +0530
committerAkshay Nair <phenax5@gmail.com>2022-01-07 18:14:06 +0530
commit6639605b395ceb1355c95e06ff0e1470adc54101 (patch)
tree01e300c50086f8db47300388ab3d7a5e5f83072d /src/types.ts
parentb3fc08cae05f997e71d846109d400e630b8a4c35 (diff)
downloadelxr-6639605b395ceb1355c95e06ff0e1470adc54101.tar.gz
elxr-6639605b395ceb1355c95e06ff0e1470adc54101.zip
refactor: simplifies quantifier logic + moves stuff around
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/types.ts b/src/types.ts
new file mode 100644
index 0000000..21e9517
--- /dev/null
+++ b/src/types.ts
@@ -0,0 +1,17 @@
+
+export type Expr =
+ | { tag: 'Start' }
+ | { tag: 'End' }
+ | { tag: 'Optional'; expr: Expr }
+ | { tag: 'OneOrMore'; expr: Expr }
+ | { tag: 'ZeroOrMore'; expr: Expr }
+ | { tag: 'NextItem' }
+ | { tag: 'AnyItem' }
+ | { tag: 'Or' }
+ | { tag: 'AnyString' }
+ | { tag: 'AnyNumber' }
+ | { tag: 'AnyBool' }
+ | { tag: 'Truthy' }
+ | { tag: 'Falsey' }
+ | { tag: 'Group'; exprs: Expr[] }
+