49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
|
// Generated file by ast_generator
|
||
|
export type EnumStatement = {
|
||
|
kind: "Enum";
|
||
|
enum_: Enum;
|
||
|
};
|
||
|
export const EnumStatement = (enum_: Enum): EnumStatement => ({ kind: "Enum", enum_ });
|
||
|
export type NodeStatement = {
|
||
|
kind: "Node";
|
||
|
node: Node;
|
||
|
};
|
||
|
export const NodeStatement = (node: Node): NodeStatement => ({ kind: "Node", node });
|
||
|
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 Param = {
|
||
|
name: Name;
|
||
|
type_: Type;
|
||
|
};
|
||
|
export const Param = (name: Name, type_: Type): Param => ({ name, type_ });
|
||
|
export type NameType = {
|
||
|
kind: "Name";
|
||
|
name: Name;
|
||
|
};
|
||
|
export const NameType = (name: Name): NameType => ({ kind: "Name", name });
|
||
|
export type OptionalType = {
|
||
|
kind: "Optional";
|
||
|
type_: Type;
|
||
|
};
|
||
|
export const OptionalType = (type_: Type): OptionalType => ({ kind: "Optional", type_ });
|
||
|
export type MultipleType = {
|
||
|
kind: "Multiple";
|
||
|
type_: Type;
|
||
|
};
|
||
|
export const MultipleType = (type_: Type): MultipleType => ({ kind: "Multiple", type_ });
|
||
|
export type Type = NameType | OptionalType | MultipleType;
|
||
|
export type Name = {
|
||
|
value: string;
|
||
|
};
|
||
|
export const Name = (value: string): Name => ({ value });
|
||
|
|