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

@ -1,5 +1,5 @@
import { ParseError } from "src/lang/parser/parser";
import { renderSpan, SourceText } from "source-text";
import { renderSpan, SourceRegion } from "source-text";
import { DisplayLineViews } from "./LineView";
export function formatErrorMesage(err: ParseError): string {
@ -118,7 +118,7 @@ function formatChar(cp: number | undefined): string {
return `'${s}'`;
}
export function ShowParseError(props: { text: SourceText, err: ParseError }) {
export function ShowParseError(props: { text: SourceRegion, err: ParseError }) {
const msg = () => formatErrorMesage(props.err);
const views = () => renderSpan(props.text, props.err.span, 3);