From 6b9a3d2ee4ec49f38f02106e3aa264946b7cdc93 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 13 Jan 2022 14:49:05 +0530 Subject: refactor: type + constructors refactor --- src/parser/index.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/parser/index.ts') diff --git a/src/parser/index.ts b/src/parser/index.ts index 386fa94..c61364d 100644 --- a/src/parser/index.ts +++ b/src/parser/index.ts @@ -20,15 +20,15 @@ import { } from './utils' import { Expr, ListExpr } from '../types' -const start = mapTo(symbol('^'), _ => Expr.Start(null)) -const end = mapTo(symbol('$'), _ => Expr.End(null)) -const anyItem = mapTo(symbol('.'), _ => Expr.AnyItem(null)) -const nextItem = mapTo(symbol(','), _ => Expr.NextItem(null)) -const anyString = mapTo(symbol('\\s'), _ => Expr.AnyString(null)) -const anyNumber = mapTo(symbol('\\n'), _ => Expr.AnyNumber(null)) -const anyBool = mapTo(symbol('\\b'), _ => Expr.AnyBool(null)) -const truthy = mapTo(symbol('\\T'), _ => Expr.Truthy(null)) -const falsey = mapTo(symbol('\\F'), _ => Expr.Falsey(null)) +const start = mapTo(symbol('^'), _ => Expr.Start()) +const end = mapTo(symbol('$'), _ => Expr.End()) +const anyItem = mapTo(symbol('.'), _ => Expr.AnyItem()) +const nextItem = mapTo(symbol(','), _ => Expr.NextItem()) +const anyString = mapTo(symbol('\\s'), _ => Expr.AnyString()) +const anyNumber = mapTo(symbol('\\n'), _ => Expr.AnyNumber()) +const anyBool = mapTo(symbol('\\b'), _ => Expr.AnyBool()) +const truthy = mapTo(symbol('\\T'), _ => Expr.Truthy()) +const falsey = mapTo(symbol('\\F'), _ => Expr.Falsey()) const wrapQuantifiers: (e: ParserResult) => ParserResult = chain( ([expr, input]) => -- cgit v1.3.1