Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
verytactical committed Feb 7, 2025
1 parent e28d4aa commit 582b800
Show file tree
Hide file tree
Showing 11 changed files with 1,999 additions and 1,319 deletions.
48 changes: 48 additions & 0 deletions src/ast/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,54 @@ export type AstBouncedMessageType = {
readonly loc: SrcInfo;
};

//
// Types (for typechecker refactoring)
//

export type AstTypeNext =
| AstTypeId
| AstTypeAs
| AstTypeTuple
| AstTypeUnit
| AstTypeTensor
| AstTypeGeneric;

export type AstTypeTuple = {
readonly kind: "tuple_type";
readonly typeArgs: readonly AstTypeNext[];
readonly id: number;
readonly loc: SrcInfo;
};

export type AstTypeUnit = {
readonly kind: "unit_type";
readonly id: number;
readonly loc: SrcInfo;
};

export type AstTypeTensor = {
readonly kind: "tensor_type";
readonly typeArgs: readonly AstTypeNext[];
readonly id: number;
readonly loc: SrcInfo;
};

export type AstTypeAs = {
readonly kind: "as_type";
readonly typeArg: AstTypeNext;
readonly name: AstId;
readonly id: number;
readonly loc: SrcInfo;
};

export type AstTypeGeneric = {
readonly kind: "generic_type";
readonly name: AstTypeId;
readonly typeArgs: readonly AstTypeNext[];
readonly id: number;
readonly loc: SrcInfo;
};

//
// Expressions
//
Expand Down
Loading

0 comments on commit 582b800

Please sign in to comment.