mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 11:11:43 +00:00
Progress
This commit is contained in:
@ -2,12 +2,18 @@ import "../src/glue/js";
|
||||
import { Compiler } from "../src/compiler";
|
||||
import { Parser } from "../src/parser";
|
||||
|
||||
const files: Map<string,string> = new Map([
|
||||
/* const files: Map<string,string> = new Map([
|
||||
["main", `import { Test as TestAlias } from "./a"; export { TestAlias } from "./d"; if (1) {} export const a: i32 = 123;`],
|
||||
["a", `export { Test } from "./b";`],
|
||||
["b", `export { Test } from "./c";`],
|
||||
["c", `export enum Test { ONE = 1, TWO = 2 }`],
|
||||
["c", `export enum Test { ONE = 1, TWO = 1 + 1 }`],
|
||||
["d", `export { Test as TestAlias } from "./b";`]
|
||||
]); */
|
||||
|
||||
const files: Map<string,string> = new Map([
|
||||
["main", `
|
||||
export function add(a: i32, b: i32): i32 { let c: i32 = a + b; return c; }
|
||||
`]
|
||||
]);
|
||||
|
||||
const parser = new Parser();
|
||||
@ -27,9 +33,10 @@ const module = compiler.compile();
|
||||
console.log("names", program.names.keys());
|
||||
console.log("exports", program.exports.keys());
|
||||
|
||||
// module.optimize();
|
||||
module.optimize();
|
||||
// module.validate(); // global initializers can't use i32.add etc. yet
|
||||
_BinaryenModulePrint(module.ref);
|
||||
if (!module.noEmit)
|
||||
_BinaryenModulePrint(module.ref);
|
||||
|
||||
/* console.log("--- statements ---");
|
||||
compiler.statements.forEach(stmt => {
|
||||
|
Reference in New Issue
Block a user