mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-14 16:35:03 +01:00
CHECK THE TYPES
This commit is contained in:
parent
35f1c92e36
commit
5c6ade6cbb
6 changed files with 670 additions and 18 deletions
23
src/index.ts
23
src/index.ts
|
|
@ -3,19 +3,15 @@ import { tokenize } from "./lexer";
|
|||
import { parse } from "./parser";
|
||||
import { printAst } from "./printer";
|
||||
import { resolve } from "./resolve";
|
||||
import { typeck } from "./typeck";
|
||||
|
||||
const input = `
|
||||
function main(argv: [String]): () = (
|
||||
print(argv);
|
||||
if 1 then (
|
||||
print("AAAAAAAAAAAAAAAAAAAA");
|
||||
let a = 0 in
|
||||
a;
|
||||
) else (
|
||||
print("AAAAAAAAAAAAAAAAAAAAAA");
|
||||
let b = 0 in
|
||||
b;
|
||||
)
|
||||
function main() = (
|
||||
let a = 0 in
|
||||
let b = a in
|
||||
let c = b in
|
||||
let d = c in
|
||||
d;
|
||||
);
|
||||
`;
|
||||
|
||||
|
|
@ -38,6 +34,11 @@ function main() {
|
|||
console.log("-----AST resolved------");
|
||||
const resolvedPrinted = printAst(resolved);
|
||||
console.log(resolvedPrinted);
|
||||
|
||||
console.log("-----AST typecked------");
|
||||
|
||||
const typecked = typeck(resolved);
|
||||
console.dir(typecked, { depth: 10 });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue