Predicator.Errors.ParseError (predicator v3.8.0)

Copy Markdown View Source

Error struct for parse errors in Predicator expressions.

This error occurs when the input expression cannot be parsed due to syntax errors.

Fields

  • message - Human-readable error description
  • line - Line number where the error occurred
  • column - Column number where the error occurred
  • position - {line, column}, derived from the fields above so generic error-reporting code can read a position uniformly across ParseError, EvaluationError, TypeMismatchError, and UndefinedVariableError

Examples

%Predicator.Errors.ParseError{
  message: "Expected number, string, boolean, date, datetime, identifier, function call, list, or '(' but found '>' at line 1, column 10",
  line: 1,
  column: 10,
  position: {1, 10}
}

Summary

Functions

Creates a parse error.

Types

t()

@type t() :: %Predicator.Errors.ParseError{
  column: pos_integer(),
  line: pos_integer(),
  message: binary(),
  position: Predicator.Types.position()
}

Functions

new(message, line, column)

@spec new(binary(), pos_integer(), pos_integer()) :: t()

Creates a parse error.