ast_generator/ast.out.ts
2024-07-21 23:35:34 +02:00

58 lines
1.7 KiB
TypeScript

// Generated file by ast_generator
export type EnumStatement = {
kind: "Enum";
[0]: Enum;
};
export const EnumStatement = (v0: Enum): EnumStatement => ({ kind: "Enum", [0]: v0 });
export type NodeStatement = {
kind: "Node";
[0]: Node;
};
export const NodeStatement = (v0: Node): NodeStatement => ({ kind: "Node", [0]: v0 });
export type Statement = EnumStatement | NodeStatement;
export type Enum = {
name: Name;
nodes: Node[];
};
export const Enum = (name: Name, nodes: Node[]): Enum => ({ name, nodes });
export type Node = {
name: Name;
params: Param[];
};
export const Node = (name: Name, params: Param[]): Node => ({ name, params });
export type NamedParam = {
kind: "Named";
name: Name;
type_: Type;
};
export const NamedParam = (name: Name, type_: Type): NamedParam => ({ kind: "Named", name, type_ });
export type UnnamedParam = {
kind: "Unnamed";
[0]: Type;
};
export const UnnamedParam = (v0: Type): UnnamedParam => ({ kind: "Unnamed", [0]: v0 });
export type Param = NamedParam | UnnamedParam;
export type NameType = {
kind: "Name";
[0]: Name;
};
export const NameType = (v0: Name): NameType => ({ kind: "Name", [0]: v0 });
export type OptionalType = {
kind: "Optional";
[0]: Type;
};
export const OptionalType = (v0: Type): OptionalType => ({ kind: "Optional", [0]: v0 });
export type MultipleType = {
kind: "Multiple";
[0]: Type;
};
export const MultipleType = (v0: Type): MultipleType => ({ kind: "Multiple", [0]: v0 });
export type Type = NameType | OptionalType | MultipleType;
export type Name = {
[0]: string;
line: number;
col: number;
};
export const Name = (v0: string, line: number, col: number): Name => ({ [0]: v0, line, col });