aboutsummaryrefslogtreecommitdiff
path: root/src/types.ts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2022-01-13 17:47:23 +0530
committerAkshay Nair <phenax5@gmail.com>2022-01-13 17:47:30 +0530
commitfc548093f151355842122912c582fc10a2d5acb2 (patch)
tree6140e512a596e501e8c08fabf5c37bb06d7ecac9 /src/types.ts
parentb6e3ecb97b34d6cf623514b3ddbbf63e4f9b21ce (diff)
downloadelxr-fc548093f151355842122912c582fc10a2d5acb2.tar.gz
elxr-fc548093f151355842122912c582fc10a2d5acb2.zip
feat(parser): adds number and boolean literals
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/types.ts b/src/types.ts
index d30413d..ac577a1 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -3,6 +3,13 @@ import { constructors, Union } from "./utils"
type _ = never
+export type Literal = Union<{
+ String: string,
+ Number: number,
+ Boolean: boolean,
+}>
+export const Literal = constructors<Literal>()
+
export type Expr = Union<{
Start: _,
End: _,
@@ -19,8 +26,8 @@ export type Expr = Union<{
Falsey: _,
Group: { exprs: Expr[] },
PropertyMatch: { name: string, exprs: Expr[] },
+ Literal: Literal,
}>
-
export const Expr = constructors<Expr>()
export type ListExpr = [