Skip to content

Commit 0c64f21

Browse files
authored
Rework resolver (AssemblyScript#489)
* Rework IR and resolver to use nested lookup tables * Integrate types into IR * Make components prefer IR, slimmed down AST * Implement `export *` * Add `@lazy` annotation and remove `--noTreeShaking` * Add `@start` annotation and remove magic `main` * Related refactoring, cleanup and docs
1 parent e623786 commit 0c64f21

File tree

234 files changed

+16624
-37546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+16624
-37546
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
cd $TRAVIS_BUILD_DIR/tests/allocators/buddy && npm run build && cd .. && npm test buddy &&
1818
cd $TRAVIS_BUILD_DIR/tests/allocators/tlsf && npm run build && cd .. && npm test tlsf;
1919
fi
20-
env: Runs the tests on node.js LTS
20+
env: Runs the tests on node.js LTS, also tests allocators
2121
- node_js: node
2222
script:
2323
- npm run all

cli/asc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ exports.main = function main(argv, options, callback) {
419419
// Begin compilation
420420
const compilerOptions = assemblyscript.createOptions();
421421
assemblyscript.setTarget(compilerOptions, 0);
422-
assemblyscript.setNoTreeShaking(compilerOptions, args.noTreeShaking);
423422
assemblyscript.setNoAssert(compilerOptions, args.noAssert);
424423
assemblyscript.setImportMemory(compilerOptions, args.importMemory);
425424
assemblyscript.setImportTable(compilerOptions, args.importTable);

cli/asc.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@
8686
"type": "b",
8787
"default": false
8888
},
89-
"noTreeShaking": {
90-
"description": "Disables compiler-level tree-shaking, compiling everything.",
91-
"type": "b",
92-
"default": false
93-
},
9489
"noAssert": {
9590
"description": "Replaces assertions with just their value without trapping.",
9691
"type": "b",

examples/game-of-life/build/optimized.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@ declare module ASModule {
88
type f32 = number;
99
type f64 = number;
1010
type bool = any;
11+
namespace JSMath {
12+
function random(): f64;
13+
}
14+
var w: i32;
15+
var h: i32;
16+
var s: i32;
1117
function init(width: i32, height: i32): void;
1218
function step(): void;
1319
function fill(x: u32, y: u32, p: f64): void;
20+
var BGR_ALIVE: u32;
21+
var BGR_DEAD: u32;
22+
var BIT_ROT: u32;
1423
}
1524
export default ASModule;
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)