mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 11:41:45 +00:00
Progress; Restructuring
This commit is contained in:
@ -3,10 +3,10 @@ import { Compiler } from "../src/compiler";
|
||||
import { Parser } from "../src/parser";
|
||||
|
||||
const files: Map<string,string> = new Map([
|
||||
["main", `import { Test } from "./a"; export { TestAlias } from "./d";`],
|
||||
["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 }`],
|
||||
["c", `export enum Test { ONE = 1, TWO = 2 }`],
|
||||
["d", `export { Test as TestAlias } from "./b";`]
|
||||
]);
|
||||
|
||||
@ -24,14 +24,14 @@ const program = parser.finish();
|
||||
const compiler = new Compiler(program);
|
||||
const module = compiler.compile();
|
||||
|
||||
console.log("names", program.names);
|
||||
console.log("exports", program.exports);
|
||||
console.log("names", program.names.keys());
|
||||
console.log("exports", program.exports.keys());
|
||||
|
||||
// module.optimize();
|
||||
// module.validate(); // global initializers can't use i32.add etc. yet
|
||||
/* _BinaryenModulePrint(module.ref);
|
||||
_BinaryenModulePrint(module.ref);
|
||||
|
||||
console.log("--- statements ---");
|
||||
/* console.log("--- statements ---");
|
||||
compiler.statements.forEach(stmt => {
|
||||
_BinaryenExpressionPrint(stmt);
|
||||
}); */
|
Reference in New Issue
Block a user