1. Yaron Minsky
  2. js-elisp

Commits

Stephen Weeks  committed e362159 Merge

auto merge

  • Participants
  • Parent commits f5d4cb9, 1ae0273
  • Branches default

Comments (0)

Files changed (1)

File ocaml/omake/omake.ml

View file
        ; "characters (?P<charbeg>[0-9]+)-(?P<charend>[0-9]+)[^\n]*"
        ])
 
+  (* File "pa_variants_conv.ml", line 1: *)
+  let error_enabled_warning_error = Regex.of_string
+    "File \"(?P<file>.+)\", line (?P<line>[0-9]+):"
+
   let polling = Regex.of_string
     "\\*\\*\\* omake: polling for filesystem changes.*"
 
 
   let to_ocaml_error t =
     let lines = Filter.f Filter.Error (List.rev t.lines) in
+    (* In OCaml 4.0, error-enabled warnings are attached to the
+       warning.  Remove the last two lines.
+
+       File "pa_variants_conv.ml", line 95, characters 6-19:
+       Warning 32: unused value variant_names.
+       File "pa_variants_conv.ml", line 1:
+       Error: Error-enabled warnings (1 occurrences) *)
     let text = String.concat ~sep:"\n" lines in
     let text, full_text = match Error.abbreviate text with
       | None -> Error.shorten_lines text, None
     in
     (* Don't write progress bars as last lines *)
     let last_line s =
-      if not (Regex.has_match Rex.progress_bar s) then
+      if Regex.has_match Rex.progress_bar s then Deferred.unit
+      else
         begin
           Window.add_line s;
           write (Last_line s)
         end
-      else
-        Deferred.unit
     in
     let iter () : unit deferred = Pipe.iter string_reader ~f:(function
       | s when String.equal (String.strip s) "" ->
             finish_error () >>= fun () ->
             write (Refresh_file (`Dir dir, `Filename_with_no_extension file))
           | [] ->
+          let rex = Rex.error_enabled_warning_error in
+          match Regex.matches rex s with
+          | _ :: _ -> finish_error ()
+          | [] ->
           let rex = Rex.ocaml_error in
           match Regex.matches rex s with
           | m :: _ ->