method SyntacticParseError.fromTextAndPosition
SyntacticParseError.fromTextAndPosition(
text: Text,
position: number,
message?: string,
): SyntacticParseError

Helper function to create a SyntacticParseError from the text and a position.

Parameters

text: Text

The text to parse.

position: number

The position in the text, 0-based.

optional
message: string = Parse error

The error message, defaults to "Parse error".

Return Type

Usage

import { SyntacticParseError } from ".";