Skip to content

Commit

Permalink
Merge pull request ocaml#10115 from ejgallego/fix_perf_coqdep_parsing
Browse files Browse the repository at this point in the history
fix(coq): Fix performance regression in coqdep unescaping
  • Loading branch information
ejgallego authored and rlepigre committed Feb 29, 2024
1 parent 73250f0 commit 235ef08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/changes/10115.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- coq: fix performance regression in coqdep unescaping (#10115, fixes
#10088, @ejgallego, thanks to Dan Christensen for the report)
3 changes: 2 additions & 1 deletion src/dune_rules/coq/coq_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ let coqdep_invalid phase line =
Note that coqdep escapes a few more things, including spaces, $, #,
[], ?, %, homedir... How to handle that seems tricky.
*)
let unescape_coqdep string = Re.replace_string (Re.compile (Re.str "\\:")) ~by:":" string
let escaped_colon = Re.compile (Re.str "\\:")
let unescape_coqdep string = Re.replace_string escaped_colon ~by:":" string

let parse_line ~dir line =
match String.lsplit2 line ~on:':' with
Expand Down

0 comments on commit 235ef08

Please sign in to comment.