From fc548093f151355842122912c582fc10a2d5acb2 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 13 Jan 2022 17:47:23 +0530 Subject: feat(parser): adds number and boolean literals --- src/types.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/types.ts') 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() + 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() export type ListExpr = [ -- cgit v1.3.1