-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ast-spec): simplify
Literal
types (#3769)
- Loading branch information
1 parent
a46e318
commit f62baec
Showing
7 changed files
with
2 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
2 changes: 0 additions & 2 deletions
2
packages/ast-spec/src/expression/literal/BigIntLiteral/spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
2 changes: 0 additions & 2 deletions
2
packages/ast-spec/src/expression/literal/BooleanLiteral/spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; | ||
} |
2 changes: 0 additions & 2 deletions
2
packages/ast-spec/src/expression/literal/NumberLiteral/spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
2 changes: 0 additions & 2 deletions
2
packages/ast-spec/src/expression/literal/RegExpLiteral/spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
packages/ast-spec/src/expression/literal/StringLiteral/spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |