class SyntacticParseError
extends ParseError

Indicates a syntactic error when parsing.

Constructors

new
SyntacticParseError(
errorMessage: string,
location?: Location,
errorLine?: string,
preceedingLines?: string[],
)

Static Methods

fromTextAndCursor(
text: Text,
cursor: TreeCursor,
): SyntacticParseError

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

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

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

Usage

import { SyntacticParseError } from ".";