Skip to content

Async main and compileString #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a8ccee6
Move memory accessors from module to memory instance
jnordberg Jan 10, 2019
4253285
Refactor
jnordberg Jan 11, 2019
4e7a1fe
Fix bug when instantiating with wrapped memory
jnordberg Jan 12, 2019
184da67
Add semicolons and lint
jnordberg Jan 18, 2019
7e38777
new Branch for parser
willemneal Jan 2, 2019
bdda8ae
Working on sections.
willemneal Jan 3, 2019
338bbd2
Remove start correctly. Now need to abstract to remove any section.
willemneal Jan 5, 2019
8c79684
new Branch for parser
willemneal Jan 2, 2019
1dd5ab9
Working on sections.
willemneal Jan 3, 2019
b14e952
Remove start correctly. Now need to abstract to remove any section.
willemneal Jan 5, 2019
24985f4
Added a test assembly file to parse instead of parser self parsing.
willemneal Jan 8, 2019
987abc0
Fix parse error
willemneal Jan 18, 2019
7fe1c2e
Add built files
willemneal Jan 18, 2019
1fca930
Initial Commit
willemneal Jan 18, 2019
acd1143
Merge remote-tracking branch 'origin/loader-memory-accessors' into li…
Jan 24, 2019
03e1b38
Added Test
Jan 24, 2019
0eb73d0
Changed to class.
Jan 24, 2019
a6c3481
Added pre and post hook for loader
willemneal Jan 25, 2019
2c7b600
Add myself to NOTICE
jnordberg Jan 27, 2019
fc8b505
Merge branch 'master' into loader-memory-accessors
jnordberg Jan 27, 2019
233d05d
Add built loader to dist/
jnordberg Feb 2, 2019
5e2196d
Rename loader to assemblyscript-loader in dist
jnordberg Feb 2, 2019
bfaee7e
Merge branch 'master' into parser_fresh
willemneal Feb 2, 2019
493b532
Merge remote-tracking branch 'jnordberg/loader-memory-accessors' into…
willemneal Feb 2, 2019
5e6fc61
Cleaning up Parser
willemneal Feb 3, 2019
fce0773
Runs again
willemneal Feb 3, 2019
87c182d
Clean up printing
willemneal Feb 3, 2019
1667b4d
Can remove start section again
willemneal Feb 3, 2019
3dc6438
Cleaned up and tests are passing
Feb 3, 2019
48efbf0
getID now returns single SectionHeader
willemneal Feb 3, 2019
ada9047
Pass tests for data section exporting
willemneal Feb 4, 2019
31eb30a
Merge remote-tracking branch 'jnordberg/loader-memory-accessors'
willemneal Feb 5, 2019
a53fbd3
fix comma
Feb 7, 2019
4db7db2
Cleaned up & added wrapped module
Feb 7, 2019
77f0448
Added ASImports class for handling imports
willemneal Feb 10, 2019
087b433
Merge branch 'parser_fresh'
willemneal Feb 10, 2019
ce3c311
Merge remote-tracking branch 'upstream/master'
willemneal Feb 10, 2019
b2891da
Merge remote-tracking branch 'upstream/master' into lib/host
willemneal Feb 10, 2019
823d8c9
Added ASImport
willemneal Feb 11, 2019
089f6ae
Added auto wrap/unwrap
willemneal Feb 12, 2019
1d4d0bf
Simplified example and updated README
willemneal Feb 12, 2019
24ef7b3
Merge branch 'lib/host'
willemneal Feb 12, 2019
ae45083
Updated compiler for RefType suffix
willemneal Feb 12, 2019
a5bffda
Added stdout redirection
willemneal Feb 19, 2019
5018529
update compiled js and types
willemneal Feb 19, 2019
ed52ff6
Merge branch 'lib/host'
willemneal Feb 19, 2019
1994193
Made stdout static
willemneal Feb 19, 2019
f4b3ab1
Forgot js and types
willemneal Feb 19, 2019
cdd09e8
pass string pointer
willemneal Feb 19, 2019
8739db1
Made more files public when installed via git
Feb 24, 2019
b6417b9
merging with master
Feb 25, 2019
2da3b63
Allow asynchronous file read/writes for cli.
willemneal Dec 5, 2018
a88a5b9
Compiler emits an empty program.
willemneal Jan 14, 2019
cfb9ac0
Forgot two awaits.
willemneal Jan 14, 2019
92f5029
Fixed up compileString and added test.
willemneal Jan 14, 2019
b8307f0
Fixed test to use asnyc.
willemneal Jan 14, 2019
c763103
test
Feb 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bin/asc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env node
const asc = module.exports = require("../cli/asc.js");
if (/\basc$/.test(process.argv[1])) process.exitCode = asc.main(process.argv.slice(2));

async function main(){
if (/\basc$/.test(process.argv[1])) {
process.exitCode = await asc.main(process.argv.slice(2));
}
}
main();
8 changes: 4 additions & 4 deletions cli/asc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ interface CompilerOptions {
}

/** Convenience function that parses and compiles source strings directly. */
export function compileString(sources: { [key: string]: string } | string, options?: CompilerOptions): {
export function compileString(sources: { [key: string]: string } | string, options?: CompilerOptions): Promise<{
/** Standard output. */
stdout: OutputStream,
/** Standard error. */
Expand All @@ -78,11 +78,11 @@ export function compileString(sources: { [key: string]: string } | string, optio
binary: Uint8Array | null,
/** Emitted text format. */
text: string | null
}
}>

/** Runs the command line utility using the specified arguments array. */
export function main(argv: string[], options: CompilerOptions, callback?: (err: Error | null) => number): number;
export function main(argv: string[], callback?: (err: Error | null) => number): number;
export function main(argv: string[], options: CompilerOptions, callback?: (err: Error | null) => number): Promise<number>;
export function main(argv: string[], callback?: (err: Error | null) => number): Promise<number>;

/** Checks diagnostics emitted so far for errors. */
export function checkDiagnostics(emitter: any, stderr?: OutputStream): boolean;
Expand Down
Loading