Set up documentation generation

This commit is contained in:
dcodeIO
2018-03-19 01:12:18 +01:00
parent c0973433d6
commit 0fef69e445
47 changed files with 523 additions and 119 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
node_modules/
npm-debug.* npm-debug.*
docs/
node_modules/
out/ out/
raw/ raw/

View File

@ -1,5 +1,5 @@
/** /**
* @file Compiler frontend for node.js * Compiler frontend for node.js
* *
* Uses the low-level API exported from src/index.ts so it works with the compiler compiled to * Uses the low-level API exported from src/index.ts so it works with the compiler compiled to
* JavaScript as well as the compiler compiled to WebAssembly (eventually). Runs the sources * JavaScript as well as the compiler compiled to WebAssembly (eventually). Runs the sources
@ -7,6 +7,8 @@
* *
* Can also be packaged as a bundle suitable for in-browser use with the standard library injected * Can also be packaged as a bundle suitable for in-browser use with the standard library injected
* in the build step. See dist/asc.js for the bundle and webpack.config.js for building details. * in the build step. See dist/asc.js for the bundle and webpack.config.js for building details.
*
* @module asc
*/ */
const fs = require("fs"); const fs = require("fs");

2
dist/asc.js vendored

File diff suppressed because one or more lines are too long

2
dist/asc.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

332
package-lock.json generated
View File

@ -10,12 +10,78 @@
"integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==", "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow==",
"dev": true "dev": true
}, },
"@types/events": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz",
"integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==",
"dev": true
},
"@types/fs-extra": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.1.tgz",
"integrity": "sha512-h3wnflb+jMTipvbbZnClgA2BexrT4w0GcfoCz5qyxd0IRsbqhLSyesM6mqZTAnhbVmhyTm5tuxfRu9R+8l+lGw==",
"dev": true,
"requires": {
"@types/node": "9.4.7"
}
},
"@types/glob": {
"version": "5.0.35",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.35.tgz",
"integrity": "sha512-wc+VveszMLyMWFvXLkloixT4n0harUIVZjnpzztaZ0nKLuul7Z32iMt2fUFGAaZ4y1XWjFRMtCI5ewvyh4aIeg==",
"dev": true,
"requires": {
"@types/events": "1.2.0",
"@types/minimatch": "3.0.3",
"@types/node": "9.4.7"
}
},
"@types/handlebars": {
"version": "4.0.36",
"resolved": "https://registry.npmjs.org/@types/handlebars/-/handlebars-4.0.36.tgz",
"integrity": "sha512-LjNiTX7TY7wtuC6y3QwC93hKMuqYhgV9A1uXBKNvZtVC8ZvyWAjZkJ5BvT0K7RKqORRYRLMrqCxpw5RgS+MdrQ==",
"dev": true
},
"@types/highlight.js": {
"version": "9.12.2",
"resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.2.tgz",
"integrity": "sha512-y5x0XD/WXDaGSyiTaTcKS4FurULJtSiYbGTeQd0m2LYZGBcZZ/7fM6t5H/DzeUF+kv8y6UfmF6yJABQsHcp9VQ==",
"dev": true
},
"@types/lodash": {
"version": "4.14.104",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.104.tgz",
"integrity": "sha512-ufQcVg4daO8xQ5kopxRHanqFdL4AI7ondQkV+2f+7mz3gvp0LkBx2zBRC6hfs3T87mzQFmf5Fck7Fi145Ul6NQ==",
"dev": true
},
"@types/marked": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-0.3.0.tgz",
"integrity": "sha512-CSf9YWJdX1DkTNu9zcNtdCcn6hkRtB5ILjbhRId4ZOQqx30fXmdecuaXhugQL6eyrhuXtaHJ7PHI+Vm7k9ZJjg==",
"dev": true
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
"dev": true
},
"@types/node": { "@types/node": {
"version": "9.4.7", "version": "9.4.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.7.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.7.tgz",
"integrity": "sha512-4Ba90mWNx8ddbafuyGGwjkZMigi+AWfYLSDCpovwsE63ia8w93r3oJ8PIAQc3y8U+XHcnMOHPIzNe3o438Ywcw==", "integrity": "sha512-4Ba90mWNx8ddbafuyGGwjkZMigi+AWfYLSDCpovwsE63ia8w93r3oJ8PIAQc3y8U+XHcnMOHPIzNe3o438Ywcw==",
"dev": true "dev": true
}, },
"@types/shelljs": {
"version": "0.7.8",
"resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.7.8.tgz",
"integrity": "sha512-M2giRw93PxKS7YjU6GZjtdV9HASdB7TWqizBXe4Ju7AqbKlWvTr0gNO92XH56D/gMxqD/jNHLNfC5hA34yGqrQ==",
"dev": true,
"requires": {
"@types/glob": "5.0.35",
"@types/node": "9.4.7"
}
},
"acorn": { "acorn": {
"version": "5.5.3", "version": "5.5.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz",
@ -48,6 +114,34 @@
"integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=", "integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=",
"dev": true "dev": true
}, },
"align-text": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"dev": true,
"requires": {
"kind-of": "3.2.2",
"longest": "1.0.1",
"repeat-string": "1.6.1"
},
"dependencies": {
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true,
"requires": {
"is-buffer": "1.1.6"
}
}
}
},
"amdefine": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
"dev": true
},
"ansi-escapes": { "ansi-escapes": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz",
@ -1351,6 +1445,26 @@
"integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
"dev": true "dev": true
}, },
"center-align": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
"integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=",
"dev": true,
"optional": true,
"requires": {
"align-text": "0.1.4",
"lazy-cache": "1.0.4"
},
"dependencies": {
"lazy-cache": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
"integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
"dev": true,
"optional": true
}
}
},
"chalk": { "chalk": {
"version": "2.3.2", "version": "2.3.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz",
@ -2491,6 +2605,17 @@
"readable-stream": "2.3.5" "readable-stream": "2.3.5"
} }
}, },
"fs-extra": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz",
"integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==",
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"jsonfile": "4.0.0",
"universalify": "0.1.1"
}
},
"fs-write-stream-atomic": { "fs-write-stream-atomic": {
"version": "1.0.10", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz",
@ -2787,6 +2912,89 @@
"lodash": "4.17.5" "lodash": "4.17.5"
} }
}, },
"handlebars": {
"version": "4.0.11",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz",
"integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=",
"dev": true,
"requires": {
"async": "1.5.2",
"optimist": "0.6.1",
"source-map": "0.4.4",
"uglify-js": "2.8.29"
},
"dependencies": {
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=",
"dev": true,
"optional": true
},
"cliui": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
"integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=",
"dev": true,
"optional": true,
"requires": {
"center-align": "0.1.3",
"right-align": "0.1.3",
"wordwrap": "0.0.2"
}
},
"source-map": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"dev": true,
"requires": {
"amdefine": "1.0.1"
}
},
"uglify-js": {
"version": "2.8.29",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
"integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=",
"dev": true,
"optional": true,
"requires": {
"source-map": "0.5.7",
"uglify-to-browserify": "1.0.2",
"yargs": "3.10.0"
},
"dependencies": {
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true,
"optional": true
}
}
},
"wordwrap": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
"integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=",
"dev": true,
"optional": true
},
"yargs": {
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
"integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=",
"dev": true,
"optional": true,
"requires": {
"camelcase": "1.2.1",
"cliui": "2.1.0",
"decamelize": "1.2.0",
"window-size": "0.1.0"
}
}
}
},
"has-ansi": { "has-ansi": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
@ -2873,6 +3081,12 @@
"minimalistic-assert": "1.0.0" "minimalistic-assert": "1.0.0"
} }
}, },
"highlight.js": {
"version": "9.12.0",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.12.0.tgz",
"integrity": "sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4=",
"dev": true
},
"hmac-drbg": { "hmac-drbg": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
@ -3484,6 +3698,15 @@
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
"dev": true "dev": true
}, },
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "4.1.11"
}
},
"keyv": { "keyv": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz",
@ -3846,6 +4069,12 @@
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
}, },
"longest": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true
},
"loose-envify": { "loose-envify": {
"version": "1.3.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz",
@ -3900,6 +4129,12 @@
"object-visit": "1.0.1" "object-visit": "1.0.1"
} }
}, },
"marked": {
"version": "0.3.17",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz",
"integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==",
"dev": true
},
"md5.js": { "md5.js": {
"version": "1.3.4", "version": "1.3.4",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz",
@ -4434,6 +4669,24 @@
"mimic-fn": "1.2.0" "mimic-fn": "1.2.0"
} }
}, },
"optimist": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
"integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
"dev": true,
"requires": {
"minimist": "0.0.10",
"wordwrap": "0.0.3"
},
"dependencies": {
"minimist": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
"dev": true
}
}
},
"ora": { "ora": {
"version": "0.2.3", "version": "0.2.3",
"resolved": "https://registry.npmjs.org/ora/-/ora-0.2.3.tgz", "resolved": "https://registry.npmjs.org/ora/-/ora-0.2.3.tgz",
@ -4821,6 +5074,12 @@
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"dev": true "dev": true
}, },
"progress": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
"integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=",
"dev": true
},
"promise-inflight": { "promise-inflight": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
@ -5207,6 +5466,16 @@
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
"dev": true "dev": true
}, },
"right-align": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
"integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=",
"dev": true,
"optional": true,
"requires": {
"align-text": "0.1.4"
}
},
"rimraf": { "rimraf": {
"version": "2.6.2", "version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
@ -6100,6 +6369,43 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
"dev": true "dev": true
}, },
"typedoc": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.11.1.tgz",
"integrity": "sha512-jdNIoHm5wkZqxQTe/g9AQ3LKnZyrzHXqu6A/c9GUOeJyBWLxNr7/Dm3rwFvLksuxRNwTvY/0HRDU9sJTa9WQSg==",
"dev": true,
"requires": {
"@types/fs-extra": "5.0.1",
"@types/handlebars": "4.0.36",
"@types/highlight.js": "9.12.2",
"@types/lodash": "4.14.104",
"@types/marked": "0.3.0",
"@types/minimatch": "3.0.3",
"@types/shelljs": "0.7.8",
"fs-extra": "5.0.0",
"handlebars": "4.0.11",
"highlight.js": "9.12.0",
"lodash": "4.17.5",
"marked": "0.3.17",
"minimatch": "3.0.4",
"progress": "2.0.0",
"shelljs": "0.8.1",
"typedoc-default-themes": "0.5.0",
"typescript": "2.7.2"
}
},
"typedoc-default-themes": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz",
"integrity": "sha1-bcJDPnjti+qOiHo6zeLzF4W9Yic=",
"dev": true
},
"typedoc-plugin-external-module-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/typedoc-plugin-external-module-name/-/typedoc-plugin-external-module-name-1.1.1.tgz",
"integrity": "sha512-Erc0MyKDGYIN7kSlIjgifVieZEogg8YwOH8bjW6RXb0y44hVeTER0UoW6Rh+n8leg6rvlPdnH092aFfcd8kRlA==",
"dev": true
},
"typescript": { "typescript": {
"version": "2.7.2", "version": "2.7.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz",
@ -6124,6 +6430,13 @@
} }
} }
}, },
"uglify-to-browserify": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz",
"integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=",
"dev": true,
"optional": true
},
"uglifyjs-webpack-plugin": { "uglifyjs-webpack-plugin": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.3.tgz", "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.3.tgz",
@ -6207,6 +6520,12 @@
"imurmurhash": "0.1.4" "imurmurhash": "0.1.4"
} }
}, },
"universalify": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
"integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=",
"dev": true
},
"unset-value": { "unset-value": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
@ -6716,6 +7035,19 @@
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true "dev": true
}, },
"window-size": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
"integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=",
"dev": true,
"optional": true
},
"wordwrap": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
"integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
"dev": true
},
"worker-farm": { "worker-farm": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz",

View File

@ -25,6 +25,8 @@
"source-map-support": "^0.5.3", "source-map-support": "^0.5.3",
"ts-loader": "^4.0.1", "ts-loader": "^4.0.1",
"tslint": "^5.9.1", "tslint": "^5.9.1",
"typedoc": "^0.11.1",
"typedoc-plugin-external-module-name": "^1.1.1",
"typescript": "^2.7.2", "typescript": "^2.7.2",
"webpack": "^4.1.1", "webpack": "^4.1.1",
"webpack-cli": "^2.0.11" "webpack-cli": "^2.0.11"
@ -48,7 +50,8 @@
"test:compiler": "node tests/compiler", "test:compiler": "node tests/compiler",
"test": "npm run test:config --scripts-prepend-node-path && npm run test:parser --scripts-prepend-node-path && npm run test:compiler --scripts-prepend-node-path", "test": "npm run test:config --scripts-prepend-node-path && npm run test:parser --scripts-prepend-node-path && npm run test:compiler --scripts-prepend-node-path",
"test:pr": "npm run clean && npm test && npm run build && npm test && npm run clean", "test:pr": "npm run clean && npm test && npm run build && npm test && npm run clean",
"all": "npm run lint && npm run clean && npm test && npm run build && npm test" "all": "npm run lint && npm run clean && npm test && npm run build && npm test",
"docs": "typedoc --tsconfig tsconfig-docs.json --mode modules --name \"AssemblyScript Compiler API\" --out ./docs/api --ignoreCompilerErrors --excludeNotExported --excludePrivate --excludeExternals --exclude **/std/** --includeDeclarations --readme src/README.md"
}, },
"files": [ "files": [
"bin/", "bin/",

View File

@ -3,7 +3,10 @@ var fs = require("fs");
var messages = require(__dirname + "/../src/diagnosticMessages.json"); var messages = require(__dirname + "/../src/diagnosticMessages.json");
var sb = [ var sb = [
"// code below is generated from diagnosticsMessages.json by scripts/build-diagnostics\n", "/**\n",
" * Generated from diagnosticsMessages.json. Do not edit.\n",
" * @module diagnostics\n",
" *//***/\n\n",
"/* tslint:disable:max-line-length */\n\n" "/* tslint:disable:max-line-length */\n\n"
]; ];
@ -11,6 +14,7 @@ function makeKey(text) {
return text.replace(/[^\w]+/g, "_").replace(/_+$/, ""); return text.replace(/[^\w]+/g, "_").replace(/_+$/, "");
} }
sb.push("/** Enum of available diagnostic codes. */\n");
sb.push("export enum DiagnosticCode {\n"); sb.push("export enum DiagnosticCode {\n");
var first = true; var first = true;
@ -24,7 +28,9 @@ Object.keys(messages).forEach(text => {
sb.push(" " + key + " = " + messages[text]); sb.push(" " + key + " = " + messages[text]);
}); });
sb.push("\n}\n\nexport function diagnosticCodeToString(code: DiagnosticCode): string {\n switch (code) {\n"); sb.push("\n}\n\n");
sb.push("/** Translates a diagnostic code to its respective string. */\n");
sb.push("export function diagnosticCodeToString(code: DiagnosticCode): string {\n switch (code) {\n");
Object.keys(messages).forEach(text => { Object.keys(messages).forEach(text => {
sb.push(" case " + messages[text] + ": return " + JSON.stringify(text) + ";\n"); sb.push(" case " + messages[text] + ": return " + JSON.stringify(text) + ";\n");

View File

@ -1,6 +1,7 @@
/** /**
* @file Abstract syntax tree representing a source file once parsed. * Abstract syntax tree representing a source file once parsed.
*/ * @module ast
*//***/
import { import {
CommonFlags, CommonFlags,
@ -16,9 +17,9 @@ import {
} from "./tokenizer"; } from "./tokenizer";
import { import {
normalize as normalizePath, normalizePath,
resolve as resolvePath resolvePath
} from "./util/path"; } from "./util";
export { Token, Range }; export { Token, Range };

View File

@ -1,6 +1,7 @@
/** /**
* @file Built-in elements providing otherwise hard-to-implement functionality. * Built-in elements providing WebAssembly core functionality.
*/ * @module builtins
*//***/
import { import {
Compiler, Compiler,

View File

@ -1,6 +1,7 @@
/** /**
* @file The AssemblyScript compiler. * The AssemblyScript compiler.
*/ * @module compiler
*//***/
import { import {
compileCall as compileBuiltinCall, compileCall as compileBuiltinCall,
@ -300,7 +301,9 @@ export class Compiler extends DiagnosticEmitter {
let pages = i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0)); let pages = i64_shr_u(i64_align(memoryOffset, 0x10000), i64_new(16, 0));
module.setMemory( module.setMemory(
i64_low(pages), i64_low(pages),
Module.MAX_MEMORY_WASM32, // TODO: not WASM64 compatible yet this.options.isWasm64
? Module.MAX_MEMORY_WASM64
: Module.MAX_MEMORY_WASM32,
this.memorySegments, this.memorySegments,
options.target, options.target,
"memory" "memory"

View File

@ -1,6 +1,7 @@
/** /**
* @file A decompiler that generates low-level AssemblyScript from WebAssembly binaries. * A decompiler that generates low-level AssemblyScript from WebAssembly binaries.
*/ * @module decompiler
*//***/
import { import {
Module, Module,

View File

@ -1,6 +1,7 @@
/** /**
* @file Definition builders for WebIDL and TypeScript. * Definition builders for WebIDL and TypeScript.
*/ * @module definitions
*//***/
import { import {
Program, Program,
@ -26,7 +27,7 @@ import {
import { import {
indent indent
} from "./util/text"; } from "./util";
/** Walker base class. */ /** Walker base class. */
abstract class ExportsWalker { abstract class ExportsWalker {

View File

@ -1,6 +1,11 @@
// code below is generated from diagnosticsMessages.json by scripts/build-diagnostics /**
* Generated from diagnosticsMessages.json. Do not edit.
* @module diagnostics
*//***/
/* tslint:disable:max-line-length */ /* tslint:disable:max-line-length */
/** Enum of available diagnostic codes. */
export enum DiagnosticCode { export enum DiagnosticCode {
Operation_not_supported = 100, Operation_not_supported = 100,
Operation_is_unsafe = 101, Operation_is_unsafe = 101,
@ -100,6 +105,7 @@ export enum DiagnosticCode {
File_0_not_found = 6054 File_0_not_found = 6054
} }
/** Translates a diagnostic code to its respective string. */
export function diagnosticCodeToString(code: DiagnosticCode): string { export function diagnosticCodeToString(code: DiagnosticCode): string {
switch (code) { switch (code) {
case 100: return "Operation not supported."; case 100: return "Operation not supported.";

View File

@ -1,6 +1,8 @@
/** /**
* @file Shared diagnostic handling inherited by the parser and the compiler. * Shared diagnostic handling inherited by the parser and the compiler.
*/ * @module diagnostics
* @preferred
*//***/
import { import {
Range Range
@ -13,7 +15,7 @@ import {
import { import {
isLineBreak isLineBreak
} from "./util/charcode"; } from "./util";
export { export {
DiagnosticCode, DiagnosticCode,

View File

@ -1,8 +1,10 @@
/** /**
* @file Abstract Syntax Tree extras. * Abstract Syntax Tree extras.
* *
* Not needed in a standalone compiler but useful for testing the parser. * Not needed in a standalone compiler but useful for testing the parser.
*/ *
* @module extra/ast
*//***/
import { import {
Node, Node,
@ -82,12 +84,9 @@ import {
} from "../tokenizer"; } from "../tokenizer";
import { import {
CharCode CharCode,
} from "../util/charcode";
import {
indent indent
} from "../util/text"; } from "../util";
import { import {
CommonFlags CommonFlags

View File

@ -1,7 +1,10 @@
/** /**
* @file TypeScript definitions for Binaryen's C-API. * TypeScript definitions for Binaryen's C-API.
* @see https://github.com/WebAssembly/binaryen/blob/master/src/binaryen-c.h *
*/ * See: https://github.com/WebAssembly/binaryen/blob/master/src/binaryen-c.h
*
* @module glue/binaryen
*//***/
declare function _malloc(size: usize): usize; declare function _malloc(size: usize): usize;
declare function _free(ptr: usize): void; declare function _free(ptr: usize): void;

View File

@ -1,6 +1,4 @@
/** /** @module glue/js *//***/
* @file Definitions for linking Binaryen with AssemblyScript.
*/
declare function allocate_memory(size: usize): usize; declare function allocate_memory(size: usize): usize;
declare function free_memory(ptr: usize): void; declare function free_memory(ptr: usize): void;

View File

@ -1,7 +1,3 @@
/**
* @file Glue code for linking Binaryen with AssemblyScript.
*/
// Copy Binaryen exports to global scope // Copy Binaryen exports to global scope
const binaryen = global.Binaryen || require("binaryen"); const binaryen = global.Binaryen || require("binaryen");

View File

@ -1,6 +1,4 @@
/** /** @module glue/js *//***/
* @file I64 definitions for JavaScript.
*/
declare type I64 = { __Long__: true }; // opaque declare type I64 = { __Long__: true }; // opaque

View File

@ -1,8 +1,3 @@
/**
* @file I64 implementation for JavaScript using long.js.
* @see https://github.com/dcodeIO/long.js
*/
const Long = global.Long || require("long"); const Long = global.Long || require("long");
global.i64_new = function(lo, hi) { global.i64_new = function(lo, hi) {

View File

@ -1,6 +1,8 @@
/** /**
* @file JavaScript glue code. * JavaScript glue code.
*/ * @module glue/js
* @preferred
*//***/
import "../../../std/portable"; import "../../../std/portable";
import "./binaryen"; import "./binaryen";

View File

@ -1,6 +1,4 @@
/** /** @module glue/js *//***/
* @file Definitions for running JavaScript under node.js.
*/
declare const global: any; declare const global: any;
declare function require(name: string): any; declare function require(name: string): any;

View File

@ -1,6 +1,4 @@
/** /** @module glue/wasm *//***/
* @file I64 wrapper for WebAssembly.
*/
type I64 = i64; type I64 = i64;
@ -151,7 +149,7 @@ function i64_to_f64(value: I64): f64 {
return <f64>value; return <f64>value;
} }
import { CharCode } from "../../util/charcode"; import { CharCode } from "../../util";
@global @global
function i64_to_string(value: I64): string { function i64_to_string(value: I64): string {

View File

@ -1,5 +1,7 @@
/** /**
* @file WebAssembly glue code. * WebAssembly glue code.
*/ * @module glue/wasm
* @preferred
*//***/
import "./i64"; import "./i64";

View File

@ -1,6 +1,7 @@
/** /**
* @file Low-level C-like compiler API. * Low-level C-like compiler API.
*/ * @module index
*//***/
import { import {
Compiler, Compiler,

View File

@ -1,6 +1,7 @@
/** /**
* @file A thin wrapper around Binaryen's C-API. * A thin wrapper around Binaryen's C-API.
*/ * @module module
*//***/
import { import {
Target Target
@ -240,8 +241,11 @@ export class Module {
ref: ModuleRef; ref: ModuleRef;
out: usize; out: usize;
/** Maximum number of pages when targeting WASM32. */
static readonly MAX_MEMORY_WASM32: Index = 0xffff; static readonly MAX_MEMORY_WASM32: Index = 0xffff;
// TODO: static readonly MAX_MEMORY_WASM64
/** Maximum number of pages when targeting WASM64. */
static readonly MAX_MEMORY_WASM64: Index = 0xffff; // TODO
static create(): Module { static create(): Module {
var module = new Module(); var module = new Module();
@ -900,7 +904,7 @@ export class Module {
_BinaryenModuleInterpret(this.ref); _BinaryenModuleInterpret(this.ref);
} }
toBinary(sourceMapUrl: string | null): Binary { toBinary(sourceMapUrl: string | null): BinaryModule {
var out = this.out; var out = this.out;
var cStr = allocString(sourceMapUrl); var cStr = allocString(sourceMapUrl);
var binaryPtr: usize = 0; var binaryPtr: usize = 0;
@ -910,7 +914,7 @@ export class Module {
binaryPtr = readInt(out); binaryPtr = readInt(out);
let binaryBytes = readInt(out + 4); let binaryBytes = readInt(out + 4);
sourceMapPtr = readInt(out + 4 * 2); sourceMapPtr = readInt(out + 4 * 2);
let ret = new Binary(); let ret = new BinaryModule();
ret.output = readBuffer(binaryPtr, binaryBytes); ret.output = readBuffer(binaryPtr, binaryBytes);
ret.sourceMap = readString(sourceMapPtr); ret.sourceMap = readString(sourceMapPtr);
return ret; return ret;
@ -1191,7 +1195,7 @@ function allocString(str: string | null): usize {
return ptr; return ptr;
} }
export function readInt(ptr: usize): i32 { function readInt(ptr: usize): i32 {
return ( return (
load<u8>(ptr ) | load<u8>(ptr ) |
(load<u8>(ptr + 1) << 8) | (load<u8>(ptr + 1) << 8) |
@ -1200,7 +1204,7 @@ export function readInt(ptr: usize): i32 {
); );
} }
export function readBuffer(ptr: usize, length: usize): Uint8Array { function readBuffer(ptr: usize, length: usize): Uint8Array {
var ret = new Uint8Array(length); var ret = new Uint8Array(length);
for (let i: usize = 0; i < length; ++i) { for (let i: usize = 0; i < length; ++i) {
ret[i] = load<u8>(ptr + i); ret[i] = load<u8>(ptr + i);
@ -1254,7 +1258,7 @@ export function readString(ptr: usize): string | null {
} }
/** Result structure of {@link Module#toBinary}. */ /** Result structure of {@link Module#toBinary}. */
class Binary { export class BinaryModule {
/** WebAssembly binary. */ /** WebAssembly binary. */
output: Uint8Array; output: Uint8Array;
/** Source map, if generated. */ /** Source map, if generated. */

View File

@ -1,6 +1,7 @@
/** /**
* @file A TypeScript parser for the AssemblyScript subset. * A TypeScript parser for the AssemblyScript subset.
*/ * @module parser
*//***/
import { import {
Program, Program,
@ -22,8 +23,8 @@ import {
} from "./diagnostics"; } from "./diagnostics";
import { import {
normalize as normalizePath normalizePath
} from "./util/path"; } from "./util";
import { import {
@ -34,7 +35,6 @@ import {
CommonTypeNode, CommonTypeNode,
TypeNode, TypeNode,
SignatureNode, SignatureNode,
CommentKind,
Expression, Expression,
AssertionKind, AssertionKind,

View File

@ -1,6 +1,7 @@
/** /**
* @file AssemblyScript's intermediate representation describing a program's elements. * AssemblyScript's intermediate representation describing a program's elements.
*/ * @module program
*//***/
import { import {
Options Options

View File

@ -1,9 +1,11 @@
/** /**
* @file A TypeScript tokenizer modified for AssemblyScript. * A TypeScript tokenizer modified for AssemblyScript.
* *
* Skips over trivia and provides a general mark/reset mechanism for the parser to utilize on * Skips over trivia and provides a general mark/reset mechanism for the parser to utilize on
* ambiguous tokens. * ambiguous tokens.
*/ *
* @module tokenizer
*//***/
import { import {
DiagnosticCode, DiagnosticCode,
@ -25,7 +27,7 @@ import {
isDecimalDigit, isDecimalDigit,
isOctalDigit, isOctalDigit,
isKeywordCharacter isKeywordCharacter
} from "./util/charcode"; } from "./util";
/** Named token types. */ /** Named token types. */
export enum Token { export enum Token {

View File

@ -1,6 +1,7 @@
/** /**
* @file Mappings from AssemblyScript types to WebAssembly types. * Mappings from AssemblyScript types to WebAssembly types.
*/ * @module types
*//***/
import { import {
Class, Class,
@ -17,25 +18,43 @@ import {
export const enum TypeKind { export const enum TypeKind {
// signed integers // signed integers
/** An 8-bit signed integer. */
I8, I8,
/** A 16-bit signed integer. */
I16, I16,
/** A 32-bit signed integer. */
I32, I32,
/** A 64-bit signed integer. */
I64, I64,
/** A 32-bit/64-bit signed integer, depending on the target. */
ISIZE, ISIZE,
// unsigned integers // unsigned integers
/** An 8-bit unsigned integer. */
U8, U8,
/** A 16-bit unsigned integer. */
U16, U16,
/** A 32-bit unsigned integer. Also the base of function types. */
U32, U32,
/** A 64-bit unsigned integer. */
U64, U64,
/** A 32-bit/64-bit unsigned integer, depending on the target. Also the base of class types. */
USIZE, USIZE,
/** A 1-bit unsigned integer. */
BOOL, // sic BOOL, // sic
// floats // floats
/** A 32-bit float. */
F32, F32,
/** A 64-bit double. */
F64, F64,
// other // other
/** No return type. */
VOID VOID
} }
@ -451,7 +470,7 @@ export class Signature {
parameterTypes: Type[]; parameterTypes: Type[];
/** Parameter names, if known, excluding `this`. */ /** Parameter names, if known, excluding `this`. */
parameterNames: string[] | null; parameterNames: string[] | null;
/** Number of required parameters. Other parameters are considered optional. */ /** Number of required parameters excluding `this`. Other parameters are considered optional. */
requiredParameters: i32; requiredParameters: i32;
/** Return type. */ /** Return type. */
returnType: Type; returnType: Type;
@ -462,6 +481,7 @@ export class Signature {
/** Cached {@link FunctionTarget}. */ /** Cached {@link FunctionTarget}. */
cachedFunctionTarget: FunctionTarget | null = null; cachedFunctionTarget: FunctionTarget | null = null;
/** Constructs a new signature. */
constructor( constructor(
parameterTypes: Type[] | null = null, parameterTypes: Type[] | null = null,
returnType: Type | null = null, returnType: Type | null = null,

View File

@ -1,6 +1,4 @@
/** /** @module util *//***/
* @file Character code utility.
*/
/** An enum of named character codes. */ /** An enum of named character codes. */
export const enum CharCode { export const enum CharCode {

9
src/util/index.ts Normal file
View File

@ -0,0 +1,9 @@
/**
* Various compiler utilities.
* @module util
* @preferred
*//***/
export * from "./charcode";
export * from "./path";
export * from "./text";

View File

@ -1,6 +1,4 @@
/** /** @module util *//***/
* @file Minimalistic path utility for normalizing and resolving relative paths.
*/
import { import {
CharCode CharCode
@ -12,7 +10,7 @@ const separator = CharCode.SLASH;
* Normalizes the specified path, removing interior placeholders. * Normalizes the specified path, removing interior placeholders.
* Expects a posix-compatible relative path (not Windows compatible). * Expects a posix-compatible relative path (not Windows compatible).
*/ */
export function normalize(path: string): string { export function normalizePath(path: string): string {
var pos = 0; var pos = 0;
var len = path.length; var len = path.length;
@ -96,11 +94,11 @@ export function normalize(path: string): string {
} }
/** Resolves the specified path relative to the specified origin. */ /** Resolves the specified path relative to the specified origin. */
export function resolve(normalizedPath: string, origin: string): string { export function resolvePath(normalizedPath: string, origin: string): string {
if (normalizedPath.startsWith("std/")) { if (normalizedPath.startsWith("std/")) {
return normalizedPath; return normalizedPath;
} }
return normalize( return normalizePath(
dirname(origin) + String.fromCharCode(separator) + normalizedPath dirname(origin) + String.fromCharCode(separator) + normalizedPath
); );
} }

View File

@ -1,6 +1,4 @@
/** /** @module util *//***/
* @file Common text utilities.
*/
const indentX1 = " "; const indentX1 = " ";
const indentX2 = " "; const indentX2 = " ";

5
std/assembly.d.ts vendored
View File

@ -1,6 +1,7 @@
/** /**
* @file Environment definitions for compiling AssemblyScript to WebAssembly using asc. * Environment definitions for compiling AssemblyScript to WebAssembly using asc.
*/ * @module std/assembly
*//***/
// Types // Types

View File

@ -1,9 +1,11 @@
/** /**
* @file Arena Memory Allocator * Arena Memory Allocator
* *
* Provides a `reset_memory` function to reset the heap to its initial state. A user has to make * Provides a `reset_memory` function to reset the heap to its initial state. A user has to make
* sure that there are no more references to cleared memory afterwards. Always aligns to 8 bytes. * sure that there are no more references to cleared memory afterwards. Always aligns to 8 bytes.
*/ *
* @module std/assembly/allocator/arena
*//***/
import { MASK as AL_MASK } from "./common/alignment"; import { MASK as AL_MASK } from "./common/alignment";

View File

@ -1,6 +1,7 @@
/** /**
* @file Buddy Memory Allocator * Buddy Memory Allocator.
*/ * @module stdd/assembly/allocator/buddy
*//***/
/* /*
Copyright 2018 Evan Wallace Copyright 2018 Evan Wallace

View File

@ -1,3 +1,8 @@
/**
* Shared alignment constants.
* @module std/assembly/allocator/common/alignment
*//***/
/** Number of alignment bits. */ /** Number of alignment bits. */
export const BITS: u32 = 3; export const BITS: u32 = 3;

View File

@ -1,10 +1,12 @@
/** /**
* @file Emscripten Memory Allocator * Emscripten Memory Allocator.
* *
* Uses Emscripten's exported _malloc and _free implementations, i.e., when linking with * Uses Emscripten's exported _malloc and _free implementations, i.e., when linking with
* Emscripten-compiled programs that already provide these. Differs from 'system' in that their * Emscripten-compiled programs that already provide these. Differs from 'system' in that their
* names are prefixed with an underscore. * names are prefixed with an underscore.
*/ *
* @module std/assembly/allocator/emscripten
*//***/
declare function _malloc(size: usize): usize; declare function _malloc(size: usize): usize;
declare function _free(ptr: usize): void; declare function _free(ptr: usize): void;

View File

@ -1,9 +1,11 @@
/** /**
* @file System Memory Allocator * System Memory Allocator.
* *
* Uses the environment's malloc and free implementations, i.e., when linking with other C-like * Uses the environment's malloc and free implementations, i.e., when linking with other C-like
* programs that already provide these. * programs that already provide these.
*/ *
* @module std/assembly/allocator/system
*//***/
declare function malloc(size: usize): usize; declare function malloc(size: usize): usize;
declare function free(ptr: usize): void; declare function free(ptr: usize): void;

View File

@ -1,9 +1,11 @@
/** /**
* @file Two-Level Segregate Fit Memory Allocator * Two-Level Segregate Fit Memory Allocator.
* *
* A general purpose dynamic memory allocator specifically designed to meet real-time requirements. * A general purpose dynamic memory allocator specifically designed to meet real-time requirements.
* Always aligns to 8 bytes. * Always aligns to 8 bytes.
*/ *
* @module std/assembly/allocator/tlsf
*//***/
// ╒══════════════ Block size interpretation (32-bit) ═════════════╕ // ╒══════════════ Block size interpretation (32-bit) ═════════════╕
// 3 2 1 // 3 2 1

8
std/portable.d.ts vendored
View File

@ -1,5 +1,5 @@
/** /**
* @file Environment definitions for compiling AssemblyScript to JavaScript using tsc. * Environment definitions for compiling AssemblyScript to JavaScript using tsc.
* *
* Note that semantic differences require additional explicit conversions for full compatibility. * Note that semantic differences require additional explicit conversions for full compatibility.
* For example, when casting an i32 to an u8, doing `<u8>(someI32 & 0xff)` will yield the same * For example, when casting an i32 to an u8, doing `<u8>(someI32 & 0xff)` will yield the same
@ -7,8 +7,10 @@
* *
* Note that i64's are not portable (JS numbers are IEEE754 doubles with a maximum safe integer * Note that i64's are not portable (JS numbers are IEEE754 doubles with a maximum safe integer
* value of 2^53-1) and instead require a compatibility layer to work in JS as well, as for example * value of 2^53-1) and instead require a compatibility layer to work in JS as well, as for example
* {@link ./glue/js/i64.d.ts} / {@link ./glue/js/i64.js}. * {@link glue/js/i64} respectively {@link glue/wasm/i64}.
*/ *
* @module std/portable
*//***/
// Portable types // Portable types

View File

@ -1,6 +1,4 @@
/** /** @module std/portable *//***/
* @file Environment implementation for compiling AssemblyScript to JavaScript using tsc.
*/
var globalScope = typeof window !== "undefined" && window || typeof global !== "undefined" && global || self; var globalScope = typeof window !== "undefined" && window || typeof global !== "undefined" && global || self;
@ -168,3 +166,5 @@ globalScope["isString"] = function isString(arg) {
}; };
globalScope["isArray"] = Array.isArray; globalScope["isArray"] = Array.isArray;
require("./portable/memory");

View File

@ -14,7 +14,6 @@
}, },
"files": [ "files": [
"./portable.d.ts", "./portable.d.ts",
"./portable.js", "./portable.js"
"./portable/memory.js"
] ]
} }

9
tsconfig-docs.json Normal file
View File

@ -0,0 +1,9 @@
{
"extends": "./src/tsconfig.json",
"include": [
"./src/**/*.ts"
],
"exclude": [
"./std/**"
]
}