Skip to content

Commit

Permalink
chore(ast-spec): simplify Literal types (#3769)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Sep 3, 2021
1 parent a46e318 commit f62baec
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions packages/ast-spec/src/base/LiteralBase.ts
@@ -1,6 +1,8 @@
import type { AST_NODE_TYPES } from '../ast-node-types';
import type { BaseNode } from './BaseNode';

export interface LiteralBase extends BaseNode {
type: AST_NODE_TYPES.Literal;
raw: string;
value: RegExp | bigint | boolean | number | string | null;
}
@@ -1,8 +1,6 @@
import type { AST_NODE_TYPES } from '../../../ast-node-types';
import type { LiteralBase } from '../../../base/LiteralBase';

export interface BigIntLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: bigint | null;
bigint: string;
}
@@ -1,8 +1,6 @@
import type { AST_NODE_TYPES } from '../../../ast-node-types';
import type { LiteralBase } from '../../../base/LiteralBase';

export interface BooleanLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: boolean;
raw: 'false' | 'true';
}
2 changes: 0 additions & 2 deletions packages/ast-spec/src/expression/literal/NullLiteral/spec.ts
@@ -1,8 +1,6 @@
import type { AST_NODE_TYPES } from '../../../ast-node-types';
import type { LiteralBase } from '../../../base/LiteralBase';

export interface NullLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: null;
raw: 'null';
}
@@ -1,7 +1,5 @@
import type { AST_NODE_TYPES } from '../../../ast-node-types';
import type { LiteralBase } from '../../../base/LiteralBase';

export interface NumberLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: number;
}
@@ -1,8 +1,6 @@
import type { AST_NODE_TYPES } from '../../../ast-node-types';
import type { LiteralBase } from '../../../base/LiteralBase';

export interface RegExpLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: RegExp | null;
regex: {
pattern: string;
Expand Down
@@ -1,7 +1,5 @@
import type { AST_NODE_TYPES } from '../../../ast-node-types';
import type { LiteralBase } from '../../../base/LiteralBase';

export interface StringLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: string;
}

0 comments on commit f62baec

Please sign in to comment.