From 0a4ba8fa95e8ceeb26d5218adc11f31f8521c6b1 Mon Sep 17 00:00:00 2001 From: SimonFJ20 Date: Mon, 18 Nov 2024 10:42:11 +0100 Subject: [PATCH] add source maps --- compiler/arch.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/compiler/arch.ts b/compiler/arch.ts index 77a73d7..203a1f1 100644 --- a/compiler/arch.ts +++ b/compiler/arch.ts @@ -1,5 +1,17 @@ -export type Ins = Ops | number; +import { Pos } from "./Token.ts"; + +export type Output = { + program: Program; + sourceMap: SourceMapping[]; +}; + export type Program = Ins[]; +export type Ins = Ops | number; + +export type SourceMapping = { + bytecodeOffset: number; + pos: Pos; +}; // NOTICE: keep up to date with runtime/arch.hpp