Update to new source-region SourceRegion abstraction
This commit is contained in:
parent
38b147c3e7
commit
909caaf7ac
12 changed files with 63 additions and 52 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue