diff options
| author | Akshay Nair <phenax5@gmail.com> | 2022-01-13 14:49:05 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2022-01-13 14:49:05 +0530 |
| commit | 6b9a3d2ee4ec49f38f02106e3aa264946b7cdc93 (patch) | |
| tree | b884da940ff47683064e1723655ed46b8ab7f85d /src/parser/index.ts | |
| parent | 6362218062a7b41e4aefe902ba5aed11aaa540c5 (diff) | |
| download | elxr-6b9a3d2ee4ec49f38f02106e3aa264946b7cdc93.tar.gz elxr-6b9a3d2ee4ec49f38f02106e3aa264946b7cdc93.zip | |
refactor: type + constructors refactor
Diffstat (limited to 'src/parser/index.ts')
| -rw-r--r-- | src/parser/index.ts | 18 |
1 files changed, 9 insertions, 9 deletions
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<Expr>) => ParserResult<Expr> = chain( ([expr, input]) => |
