Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@
];
};

# Due to a Reason version mismatch, the generated OCaml PPX diff
# looks different
doCheck = false;
doCheck = true;
nativeCheckInputs = [
reason
merlin
pkgs.jq
];
propagatedBuildInputs = [ ppxlib_gt_0_37 ];
};

Expand All @@ -81,6 +84,8 @@
nativeBuildInputs = [
melange
reason
merlin
pkgs.jq
];
propagatedBuildInputs = [
melange
Expand Down
5 changes: 3 additions & 2 deletions ppx/test/dune
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
(cram
(package reason-react-ppx)
(deps
(package reason-react)
%{bin:reason-react-ppx}
%{bin:refmt}
%{bin:dune}
%{bin:jq}
%{bin:ocamlmerlin}
ppx.sh))
%{bin:bash}
ppx.sh
run-ppx.sh))
28 changes: 2 additions & 26 deletions ppx/test/ppx.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
#!/bin/bash

set -eo pipefail

function usage() {
echo "Usage: $(basename "$0") --output re [file.re]"
echo " $(basename "$0") --output ml [file.re]"
}

if [ -z "$3" ]; then
usage
exit
fi

refmt --parse re --print ml "$3" > output.ml
reason-react-ppx --impl output.ml -o temp.ml

if [ "$2" == "ml" ]; then
cat temp.ml
exit
elif [ "$2" == "re" ]; then
refmt --parse ml --print re temp.ml
exit
else
usage
exit
fi
root_path=$PWD
bash "$(dirname "$0")/run-ppx.sh" "$@"
25 changes: 25 additions & 0 deletions ppx/test/run-ppx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set -eo pipefail

function usage() {
echo "Usage: $(basename "$0") --output re [file.re]"
echo " $(basename "$0") --output ml [file.re]"
}

if [ -z "$3" ]; then
usage
exit
fi

refmt --parse re --print ml "$3" > output.ml
reason-react-ppx --impl output.ml -o temp.ml

if [ "$2" == "ml" ]; then
cat temp.ml
exit
elif [ "$2" == "re" ]; then
refmt --parse ml --print re temp.ml
exit
else
usage
exit
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.