ast_generator/ast.out.ts
2024-07-29 02:54:28 +02:00

89 lines
2.8 KiB
TypeScript

// Generated file by ast_generator
export type Statement_CodeBlock = {
type: "Statement",
kind: "CodeBlock",
[0]: CodeBlock,
};
export const Statement_CodeBlock = (v0: CodeBlock): Statement_CodeBlock => ({ type: "Statement", kind: "CodeBlock", [0]: v0 });
export type Statement_Enum = {
type: "Statement",
kind: "Enum",
[0]: Enum,
};
export const Statement_Enum = (v0: Enum): Statement_Enum => ({ type: "Statement", kind: "Enum", [0]: v0 });
export type Statement_Node = {
type: "Statement",
kind: "Node",
[0]: Node,
};
export const Statement_Node = (v0: Node): Statement_Node => ({ type: "Statement", kind: "Node", [0]: v0 });
export type Statement = Statement_CodeBlock | Statement_Enum | Statement_Node;
export const Statement = { CodeBlock: Statement_CodeBlock, Enum: Statement_Enum, Node: Statement_Node } as const;
export type CodeBlock = {
type: "CodeBlock";
[0]: string;
};
export const CodeBlock = (v0: string): CodeBlock => ({ type: "CodeBlock", [0]: v0 });
export type Enum = {
type: "Enum";
name: Name;
nodes: Node[];
};
export const Enum = (name: Name, nodes: Node[]): Enum => ({ type: "Enum", name, nodes });
export type Node = {
type: "Node";
name: Name;
params: Param[];
};
export const Node = (name: Name, params: Param[]): Node => ({ type: "Node", name, params });
export type Param_Named = {
type: "Param",
kind: "Named",
name: Name,
type_: Type,
};
export const Param_Named = (name: Name, type_: Type): Param_Named => ({ type: "Param", kind: "Named", name, type_ });
export type Param_Unnamed = {
type: "Param",
kind: "Unnamed",
[0]: Type,
};
export const Param_Unnamed = (v0: Type): Param_Unnamed => ({ type: "Param", kind: "Unnamed", [0]: v0 });
export type Param = Param_Named | Param_Unnamed;
export const Param = { Named: Param_Named, Unnamed: Param_Unnamed } as const;
export type Type_Name = {
type: "Type",
kind: "Name",
[0]: Name,
};
export const Type_Name = (v0: Name): Type_Name => ({ type: "Type", kind: "Name", [0]: v0 });
export type Type_Optional = {
type: "Type",
kind: "Optional",
[0]: Type,
};
export const Type_Optional = (v0: Type): Type_Optional => ({ type: "Type", kind: "Optional", [0]: v0 });
export type Type_Multiple = {
type: "Type",
kind: "Multiple",
[0]: Type,
};
export const Type_Multiple = (v0: Type): Type_Multiple => ({ type: "Type", kind: "Multiple", [0]: v0 });
export type Type = Type_Name | Type_Optional | Type_Multiple;
export const Type = { Name: Type_Name, Optional: Type_Optional, Multiple: Type_Multiple } as const;
export type Name = {
type: "Name";
[0]: string;
line: number;
col: number;
};
export const Name = (v0: string, line: number, col: number): Name => ({ type: "Name", [0]: v0, line, col });