diff --git a/cli/asc.js b/cli/asc.js index eda2e339..b0ee8332 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -82,15 +82,6 @@ exports.libraryFiles = exports.isBundle ? BUNDLE_LIBRARY : (() => { // set up if return bundled; })(); -/** Bundled runtime templates. */ -exports.runtimeTemplates = exports.isBundle ? BUNDLE_RUNTIME : (() => { - const rtDir = path.join(__dirname, "..", "std", "runtime"); - const rtFiles = require("glob").sync("**/!(*.d).ts", { cwd: rtDir }); - const bundled = {}; - rtFiles.forEach(file => bundled[file.replace(/\.ts$/, "")] = fs.readFileSync(path.join(rtDir, file), "utf8" )); - return bundled; -})(); - /** Bundled definition files. */ exports.definitionFiles = exports.isBundle ? BUNDLE_DEFINITIONS : (() => { // set up if not a bundle const stdDir = path.join(__dirname, "..", "std"); @@ -401,7 +392,7 @@ exports.main = function main(argv, options, callback) { // Include runtime template { let templateName = String(args.runtime); - let templateText = exports.runtimeTemplates[templateName]; + let templateText = exports.libraryFiles["runtime/" + templateName]; if (templateText == null) { templateText = readFile(templateName + ".ts", baseDir); if (templateText == null) { diff --git a/std/runtime/README.md b/std/assembly/runtime/README.md similarity index 82% rename from std/runtime/README.md rename to std/assembly/runtime/README.md index 97a02d1e..a25e30ef 100644 --- a/std/runtime/README.md +++ b/std/assembly/runtime/README.md @@ -10,8 +10,8 @@ $> asc ... The [default runtime](./default.ts) adds proper support for dynamic memory management and garbage collection to your program. -* [TLSF memory allocator](../assembly/allocator/tlsf.ts) -* [ITCM garbage collector](../assembly/collector/itcm.ts) +* [TLSF memory allocator](../allocator/tlsf.ts) +* [ITCM garbage collector](../collector/itcm.ts) Arena ----- @@ -22,7 +22,7 @@ $> asc ... --runtime arena The [arena runtime](./arena.ts) is just enough to make most language features work, but doesn't have sophisticated support for freeing memory. Useful when prototyping or for simple one-shot modules in that it produces very small modules with minimal overhead. -* [Arena memory allocator](../assembly/allocator/arena.ts) with `memory.reset()` +* [Arena memory allocator](../allocator/arena.ts) with `memory.reset()` * No garbage collector None diff --git a/std/runtime/arena.ts b/std/assembly/runtime/arena.ts similarity index 53% rename from std/runtime/arena.ts rename to std/assembly/runtime/arena.ts index 9a31c7a4..8b75953b 100644 --- a/std/runtime/arena.ts +++ b/std/assembly/runtime/arena.ts @@ -1 +1,3 @@ import "allocator/arena"; + +// export { memory }; diff --git a/std/runtime/default.ts b/std/assembly/runtime/default.ts similarity index 64% rename from std/runtime/default.ts rename to std/assembly/runtime/default.ts index 22cbcdaf..6131b14b 100644 --- a/std/runtime/default.ts +++ b/std/assembly/runtime/default.ts @@ -1,2 +1,4 @@ import "allocator/tlsf"; import "collector/itcm"; + +// export { memory, gc }; diff --git a/std/runtime/none.ts b/std/assembly/runtime/none.ts similarity index 100% rename from std/runtime/none.ts rename to std/assembly/runtime/none.ts diff --git a/std/runtime/tsconfig.json b/std/runtime/tsconfig.json deleted file mode 100644 index e48ae586..00000000 --- a/std/runtime/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../assembly.json", - "include": [ - "./**/*.ts" - ] -}