mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-14 16:35:03 +01:00
eagerly load crates from extern mod items
This commit is contained in:
parent
2f1f4a9798
commit
e455e71aa2
2 changed files with 21 additions and 12 deletions
10
src/index.ts
10
src/index.ts
|
|
@ -13,6 +13,7 @@ import { GlobalContext, parseArgs } from "./context";
|
|||
import { loadCrate } from "./loader";
|
||||
|
||||
const INPUT = `
|
||||
extern mod a;
|
||||
type A = { a: Int };
|
||||
|
||||
function main() = (
|
||||
|
|
@ -22,13 +23,8 @@ function main() = (
|
|||
|
||||
function printA(a: A) = (
|
||||
print("ABCDEFGH\\n");
|
||||
std.printlnInt(a.a);
|
||||
print("ABCDEFGH\\n");
|
||||
);
|
||||
|
||||
function linkStd() = (
|
||||
std.println("a");
|
||||
);
|
||||
`;
|
||||
|
||||
function main() {
|
||||
|
|
@ -47,12 +43,12 @@ function main() {
|
|||
const gcx = new GlobalContext(opts, loadCrate);
|
||||
const mainCrate = gcx.crateId.next();
|
||||
|
||||
gcx.crateLoader(gcx, "std", Span.startOfFile(file));
|
||||
|
||||
withErrorPrinter(
|
||||
() => {
|
||||
const start = Date.now();
|
||||
|
||||
gcx.crateLoader(gcx, "std", Span.startOfFile(file));
|
||||
|
||||
const tokens = tokenize(file);
|
||||
if (debug.has("tokens")) {
|
||||
console.log("-----TOKENS------------");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue