Skip to content

Commit

Permalink
feat(dune): support + prefixes for PPX CLI flags
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
  • Loading branch information
anmonteiro committed Dec 21, 2024
1 parent d999826 commit e85775d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/dune_rules/preprocess.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ module Pps_and_flags = struct
and+ syntax_version = Dune_lang.Syntax.get_exn Stanza.syntax in
let pps, more_flags =
List.partition_map l ~f:(fun s ->
match String_with_vars.is_prefix ~prefix:"-" s with
| Yes -> Right s
| No | Unknown _ ->
match
( String_with_vars.is_prefix ~prefix:"-" s
, String_with_vars.is_prefix ~prefix:"+" s )
with
| Yes, _ | _, Yes -> Right s
| (No | Unknown _), _ ->
let loc = String_with_vars.loc s in
(match String_with_vars.text_only s with
| None ->
Expand Down
7 changes: 0 additions & 7 deletions test/blackbox-tests/test-cases/ppx/ppx-flags-plus.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,3 @@ Create ppx1 and exe:
$ touch the_exe.ml

$ dune build ./the_exe.exe
File "dune", line 9, characters 30-35:
9 | (preprocess (pps ppx --alert ++foo)))
^^^^^
Error: Library "++foo" not found.
-> required by _build/default/.merlin-conf/exe-the_exe
-> required by _build/default/the_exe.exe
[1]

0 comments on commit e85775d

Please sign in to comment.