-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial implementation for source map from Fift assembly file f…
…rom FunC
- Loading branch information
Showing
14 changed files
with
4,317 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {readFileSync} from "node:fs" | ||
import {compileFift} from "../fift/compileFift" | ||
|
||
export type ProcedureHash = string | ||
|
||
export type SourceMap = Map<ProcedureHash, string> | ||
|
||
export async function obtainSourceMap(path: string): Promise<SourceMap> { | ||
const content = readFileSync(path).toString() | ||
const result = await compileFift(content, true) | ||
if (result.status !== "source_map") { | ||
return new Map() | ||
} | ||
return result.sourceMap | ||
} |
Oops, something went wrong.