Update to new source-region SourceRegion abstraction

This commit is contained in:
Yura Dupyn 2026-04-06 19:47:06 +02:00
parent 38b147c3e7
commit 909caaf7ac
12 changed files with 63 additions and 52 deletions

View file

@ -3,7 +3,7 @@ import { useProgram } from 'src/ui/ProgramProvider';
import { eval_start } from 'src/lang/eval/evaluator';
import { Value } from 'src/lang/eval/value';
import { RuntimeError } from 'src/lang/eval/error';
import { SourceText, sourceText } from 'source-text';
import { SourceRegion, SourceText, sourceText } from 'source-text';
import { ParseError, parseExpr } from 'src/lang/parser/parser';
import { ShowParseError } from 'src/ui/Component/ParseError';
import { Val } from 'src/ui/Component/Value';
@ -15,7 +15,7 @@ namespace ReplResult {
export type Success =
{ tag: "success", value: Value }
export type Parse_Error =
{ tag: "parse_error", text: SourceText, err: ParseError }
{ tag: "parse_error", text: SourceRegion, err: ParseError }
export type Runtime_Error =
{ tag: "runtime_error", err: RuntimeError }
}
@ -39,7 +39,7 @@ export function ExprREPL() {
if (input().trim() === "") {
return;
}
const text = sourceText(raw);
const text = sourceText(raw).fullRegion();
const parseResult = parseExpr(text);
if (parseResult.tag === "error") {