Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-ppxlib for openSUSE:Factory checked in at 2021-06-25 15:01:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-ppxlib (Old) and /work/SRC/openSUSE:Factory/.ocaml-ppxlib.new.2625 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-ppxlib" Fri Jun 25 15:01:19 2021 rev:2 rq:901571 version:0.22.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-ppxlib/ocaml-ppxlib.changes 2021-04-29 01:37:54.726536912 +0200 +++ /work/SRC/openSUSE:Factory/.ocaml-ppxlib.new.2625/ocaml-ppxlib.changes 2021-06-25 15:02:00.992201242 +0200 @@ -1,0 +2,6 @@ +Tue Jun 15 15:15:15 UTC 2021 - [email protected] + +- Update to version 0.22.1 + See included CHANGES.md for details + +------------------------------------------------------------------- Old: ---- ocaml-ppxlib-0.22.0.tar.xz New: ---- ocaml-ppxlib-0.22.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-ppxlib.spec ++++++ --- /var/tmp/diff_new_pack.CKutGc/_old 2021-06-25 15:02:01.396201735 +0200 +++ /var/tmp/diff_new_pack.CKutGc/_new 2021-06-25 15:02:01.396201735 +0200 @@ -29,7 +29,7 @@ %define pkg ocaml-ppxlib Name: %{pkg}%{nsuffix} -Version: 0.22.0 +Version: 0.22.1 Release: 0 %{?ocaml_preserve_bytecode} Summary: Base library and tools for ppx rewriters ++++++ _service ++++++ --- /var/tmp/diff_new_pack.CKutGc/_old 2021-06-25 15:02:01.436201784 +0200 +++ /var/tmp/diff_new_pack.CKutGc/_new 2021-06-25 15:02:01.436201784 +0200 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> <param name="filename">ocaml-ppxlib</param> - <param name="revision">06a2c9bdad8c1d3361a3d9430e9bf58476b08590</param> + <param name="revision">5830d89a7cbe3a683a5d7d9948e2d14cffffa8d3</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/ocaml-ppx/ppxlib.git</param> ++++++ ocaml-ppxlib-0.22.0.tar.xz -> ocaml-ppxlib-0.22.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/.gitignore new/ocaml-ppxlib-0.22.1/.gitignore --- old/ocaml-ppxlib-0.22.0/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/.gitignore 2021-06-10 11:31:23.000000000 +0200 @@ -0,0 +1,3 @@ +_build +*.install +*.merlin diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/CHANGES.md new/ocaml-ppxlib-0.22.1/CHANGES.md --- old/ocaml-ppxlib-0.22.0/CHANGES.md 2021-02-04 17:27:47.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/CHANGES.md 2021-06-10 11:31:23.000000000 +0200 @@ -1,3 +1,8 @@ +0.22.1 (10/06/2021) +------------------- + +- Fix location in parse error reporting (#257, @pitag-ha) + 0.22.0 (04/02/2021) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/ast/location_error.ml new/ocaml-ppxlib-0.22.1/ast/location_error.ml --- old/ocaml-ppxlib-0.22.0/ast/location_error.ml 2021-02-04 17:27:47.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/ast/location_error.ml 2021-06-10 11:31:23.000000000 +0200 @@ -123,3 +123,11 @@ let update_loc error loc = (*IF_NOT_AT_LEAST 408 update_loc_old error loc*) (*IF_AT_LEAST 408 update_loc_new error loc*) + +let _get_location_old { loc; _ } = loc + +let _get_location_new { main; _ } = main.loc + +let get_location error = + (*IF_NOT_AT_LEAST 408 _get_location_old error *) + (*IF_AT_LEAST 408 _get_location_new error *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/ast/location_error.mli new/ocaml-ppxlib-0.22.1/ast/location_error.mli --- old/ocaml-ppxlib-0.22.0/ast/location_error.mli 2021-02-04 17:27:47.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/ast/location_error.mli 2021-06-10 11:31:23.000000000 +0200 @@ -8,3 +8,4 @@ val to_extension : t -> Import.Parsetree.extension val raise : t -> 'a val update_loc : t -> Location.t -> t +val get_location : t -> Location.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/src/driver.ml new/ocaml-ppxlib-0.22.1/src/driver.ml --- old/ocaml-ppxlib-0.22.0/src/driver.ml 2021-02-04 17:27:47.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/src/driver.ml 2021-06-10 11:31:23.000000000 +0200 @@ -707,9 +707,10 @@ ~loc:(Location.in_file fn) "Expected a binary AST as input" | Error (System_error (error, _)) | Error (Source_parse_error (error, _)) -> - Location.in_file fn - |> Location.Error.update_loc error - |> Location.Error.raise + let open Location.Error in + Location.set_filename (get_location error) fn + |> update_loc error + |> raise ;; let load_source_file fn = @@ -918,9 +919,10 @@ | Error (error, input_version) when embed_errors -> (input_name, input_version, error_to_extension error ~kind) | Error (error, _) -> - Location.in_file fn - |> Location.Error.update_loc error - |> Location.Error.raise + let open Location.Error in + Location.set_filename (get_location error) fn + |> update_loc error + |> raise in Option.iter !output_metadata_filename ~f:(fun fn -> let metadata = File_property.dump_and_reset_all () in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/src/location.ml new/ocaml-ppxlib-0.22.1/src/location.ml --- old/ocaml-ppxlib-0.22.0/src/location.ml 2021-02-04 17:27:47.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/src/location.ml 2021-06-10 11:31:23.000000000 +0200 @@ -21,6 +21,15 @@ ; loc_ghost = true } +let set_filename loc fn = + let loc_start = + {loc.loc_start with pos_fname = fn} + in + let loc_end = + {loc.loc_end with pos_fname = fn} + in + {loc with loc_start; loc_end} + let none = in_file "_none_" let init lexbuf fname = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/src/location.mli new/ocaml-ppxlib-0.22.1/src/location.mli --- old/ocaml-ppxlib-0.22.0/src/location.mli 2021-02-04 17:27:47.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/src/location.mli 2021-06-10 11:31:23.000000000 +0200 @@ -14,6 +14,9 @@ (** Return an empty ghost range located in a given file. *) val in_file : string -> t +(** Set the [pos_fname] both in [loc_start] and [loc_end]. Leave the rest as is. *) +val set_filename : t -> string -> t + (** An arbitrary value of type [t]; describes an empty ghost range. *) val none : t @@ -70,7 +73,11 @@ same as [Location.raise_errorf]. *) val raise : t -> 'a + (** Update where the error is located. The old location will be overwritten. *) val update_loc : t -> location -> t + + (** Find out where the error is located. *) + val get_location : t -> location end with type location := t exception Error of Error.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/test/driver/parse_error_locations/dune new/ocaml-ppxlib-0.22.1/test/driver/parse_error_locations/dune --- old/ocaml-ppxlib-0.22.0/test/driver/parse_error_locations/dune 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/test/driver/parse_error_locations/dune 2021-06-10 11:31:23.000000000 +0200 @@ -0,0 +1,6 @@ +(executable + (name identity_standalone) + (libraries ppxlib)) + +(cram + (deps identity_standalone.exe)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/test/driver/parse_error_locations/identity_standalone.ml new/ocaml-ppxlib-0.22.1/test/driver/parse_error_locations/identity_standalone.ml --- old/ocaml-ppxlib-0.22.0/test/driver/parse_error_locations/identity_standalone.ml 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/test/driver/parse_error_locations/identity_standalone.ml 2021-06-10 11:31:23.000000000 +0200 @@ -0,0 +1 @@ +let _ = Ppxlib.Driver.standalone () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-ppxlib-0.22.0/test/driver/parse_error_locations/run.t new/ocaml-ppxlib-0.22.1/test/driver/parse_error_locations/run.t --- old/ocaml-ppxlib-0.22.0/test/driver/parse_error_locations/run.t 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-ppxlib-0.22.1/test/driver/parse_error_locations/run.t 2021-06-10 11:31:23.000000000 +0200 @@ -0,0 +1,15 @@ +Keep the error output short in order to avoid different error output between +different compiler versions in the subsequent test + + $ export OCAML_ERROR_STYLE=short + +Syntax errors in files parsed by ppxlib are reported correctly + + $ cat > test.ml << EOF + > let x = 5 + > let let + > EOF + $ ./identity_standalone.exe -impl test.ml + File "test.ml", line 2, characters 4-7: + Error: Syntax error + [1]
