From 06f85503fe45868709c9922649c24845db8a5f78 Mon Sep 17 00:00:00 2001 From: Drew Youngwerth Date: Mon, 2 Sep 2024 21:05:21 -0700 Subject: [PATCH] Fix location directory annotation --- src/cli/exec.ts | 5 ++--- src/parser/utils/parse-file.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cli/exec.ts b/src/cli/exec.ts index 5f35a772..a79cecad 100644 --- a/src/cli/exec.ts +++ b/src/cli/exec.ts @@ -6,6 +6,7 @@ import { processSemantics } from "../semantics/index.js"; import binaryen from "binaryen"; import { testGc } from "../lib/binaryen-gc/test.js"; import { parseFile, parseModuleFromSrc } from "../parser/index.js"; +import { compileSrc } from "../compiler.js"; export const exec = () => main().catch(errorHandler); @@ -70,9 +71,7 @@ async function getMacroAst(index: string) { } async function getWasmMod(index: string, optimize = false) { - const module = await parseModuleFromSrc(index); - const checkedAst = processSemantics(module); - const mod = assemble(checkedAst); + const mod = await compileSrc(index); if (optimize) { binaryen.setShrinkLevel(3); diff --git a/src/parser/utils/parse-file.ts b/src/parser/utils/parse-file.ts index ae309784..4a3cc45e 100644 --- a/src/parser/utils/parse-file.ts +++ b/src/parser/utils/parse-file.ts @@ -4,5 +4,5 @@ import { List } from "../../syntax-objects/list.js"; export const parseFile = async (path: string): Promise => { const file = fs.readFileSync(path, { encoding: "utf8" }); - return parse(file); + return parse(file, path); };