diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2025-11-02 18:08:16 -0800 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2025-11-02 18:09:14 -0800 |
| commit | e9f3c782bc10d4c5c44faf768aa60cd6bcc66574 (patch) | |
| tree | cb4e447a5ce5deffe989a65ff774e90f0e8ad518 /src/lib/core/common.ts | |
| parent | f53622d63c74a1e2dd0397f4a26f31aa72dea60b (diff) | |
refactor
Diffstat (limited to 'src/lib/core/common.ts')
| -rw-r--r-- | src/lib/core/common.ts | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/lib/core/common.ts b/src/lib/core/common.ts deleted file mode 100644 index c1a1dc3..0000000 --- a/src/lib/core/common.ts +++ /dev/null @@ -1,57 +0,0 @@ -export enum TokenType { - OPEN_PAREN = "(", - CLOSE_PAREN = ")", - SPACE = " ", - SEMICOLON = ";", - COMMA = ",", - NAME = "NAME", -} - -export enum TokenSubType { - NA = "NA", - LITERAL = "LITERAL", - REFERENCE = "REFERENCE", -} - -export type Token< - Type extends TokenType = TokenType, - Name extends string = string -> = { - type: Type; - name: Name; -}; - -export type LexerCtx = { - next: string; - nameCollection: string; - tokens: readonly Token[]; -}; - -export enum NodeType { - INT = "INT", - EXT = "EXT", - PARSER_ERROR = "PARSER_ERROR", -} - -export type ASTNode< - Type extends NodeType = NodeType, - Name extends string = string, - Value extends any = any, - Children extends readonly ASTNode[] = readonly ASTNode< - NodeType, - string, - any, - any - >[] -> = { - type: Type; - name: Name; - value: Value; - children: Children; -}; - -export type ParserCtx = { - remainingTokens: readonly Token[]; - lastToken: Token | null; - stack: readonly ASTNode[]; -}; |
