Module Sexps_rewriter.Parse_error

type t = {
  1. loc : Loc.t;
  2. message : string;
}

When creating a rewriter, we first parse sexps from the original contents provided. This may result in parsing errors.

The type is intended to make it easy to connect to code using Err, such as shown below:

  match Sexps_rewriter.create ~path ~original_contents with
  | Ok r -> r
  | Error { loc; message } -> Err.raise ~loc [ Pp.text message ]