-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[new-syntax]
stmts-next/
-- DefineType
- Loading branch information
Showing
4 changed files
with
44 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { appendReport } from "../errors/appendReport" | ||
import { Exp } from "../exp" | ||
import { Mod } from "../mod" | ||
import { Span } from "../span" | ||
import { Stmt } from "../stmt-next" | ||
|
||
export type TypeParameter = { | ||
name: string | ||
t: Exp | ||
} | ||
|
||
export class DefineType implements Stmt { | ||
constructor( | ||
public name: string, | ||
public input: Array<TypeParameter>, | ||
public output: Array<TypeParameter>, | ||
public span: Span, | ||
) {} | ||
|
||
async execute(mod: Mod): Promise<void> { | ||
try { | ||
// TODO | ||
} catch (error) { | ||
throw appendReport(error, { | ||
message: [ | ||
`[DefineNode.execute] I fail to define node.`, | ||
``, | ||
` node name: ${this.name}`, | ||
].join("\n"), | ||
context: { | ||
span: this.span, | ||
text: mod.text, | ||
}, | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./DefineNode" | ||
export * from "./DefineType" |