package pyre-ast

  1. Overview
  2. Docs

This module contains a type that represents parsing errors.

type t = {
  1. message : string;
  2. line : int;
  3. column : int;
  4. end_line : int;
  5. end_column : int;
}

Line numbers start from 1 and column numbers start from 1.

Note that it is possible for any of these line/column numbers to be set to -1. This can happen either when CPython runtime encounters a non-syntax error, or when an unexpected internal error occurs during parsing. It is also possible that CPython runtime sometimes set the end locations to come before the start locations. If needed, clients are expected to perform their own validations on the location numbers -- this library is only responsible of forwarding whatever data that comes from the CPython side.

OCaml

Innovation. Community. Security.