From eef76e2e40f68b394d9fe155a9f20b6072035cbd Mon Sep 17 00:00:00 2001 From: Kaz Wesley Date: Tue, 26 Sep 2023 17:01:24 +0000 Subject: [PATCH] Cleanup. --- app/gui2/parser-codegen/src/prototype.ts | 124 ----------------------- 1 file changed, 124 deletions(-) delete mode 100644 app/gui2/parser-codegen/src/prototype.ts diff --git a/app/gui2/parser-codegen/src/prototype.ts b/app/gui2/parser-codegen/src/prototype.ts deleted file mode 100644 index cee459722077..000000000000 --- a/app/gui2/parser-codegen/src/prototype.ts +++ /dev/null @@ -1,124 +0,0 @@ -class LazyObject { - protected readonly blob: Uint8Array - protected readonly address: number -} - -export module Tree { - export type Tree = Ident | NamedApp - - export enum Type { - Ident = 0, - NamedApp = 1, - } - - class Base extends LazyObject { - get span(): Span { - throw new Error('TODO') - } - - children(): Iterable { - throw new Error('TODO') - } - } - - export class Ident extends Base { - readonly type: Type.Ident - - get token(): Token.Ident { - throw new Error('TODO') - } - } - - export class NamedApp extends Base { - readonly type: Type.NamedApp - - get func(): Tree { - throw new Error('TODO') - } - - get open(): Token.OpenSymbol | undefined { - throw new Error('TODO') - } - - get name(): Token.Ident { - throw new Error('TODO') - } - - get equals(): Token.Operator { - throw new Error('TODO') - } - - get arg(): Tree { - throw new Error('TODO') - } - - get close(): Token.CloseSymbol | undefined { - throw new Error('TODO') - } - } -} -export type Tree = Tree.Tree - -function switchTree(tree: Tree) { - const c = tree.type - const span = tree.span - switch (c) { - case Tree.Type.Ident: - return 'ident' - case Tree.Type.NamedApp: - return 'named app' - default: - const _ = c satisfies never - } -} - -export class Span extends LazyObject { - get start(): number { - throw new Error('TODO') - } - - get len(): number { - throw new Error('TODO') - } -} - -export type Token = Token.Ident | Token.Operator | Token.OpenSymbol | Token.CloseSymbol - -export module Token { - export enum Type { - Ident, - Operator, - OpenSymbol, - CloseSymbol, - } - - class Base { - protected readonly blob: Uint8Array - protected readonly address: number - readonly type: Type - - get span(): Span { - throw new Error('TODO') - } - } - - export class Ident extends Base { - readonly type: Type.Ident - - get isTypeOrConstructor(): boolean { - throw new Error('TODO') - } - } - - export class Operator extends Base { - readonly type: Type.Operator - } - - export class OpenSymbol extends Base { - readonly type: Type.OpenSymbol - } - - export class CloseSymbol extends Base { - readonly type: Type.CloseSymbol - } -}