blob: 093dd1977b19fb17f6a4e1c081c5f45a65709162 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#!/usr/bin/env bash
set -e
rm -f "$3"
F2=$(mktemp --suffix=".y")
F3=$(mktemp --suffix=".hs")
cp "$2" "$F2" # needed because happy rejects files that do not have the .y extension
happy -agc --strict --outfile="$F3" "$F2"
ghc -E "$F3" -o "$3" # needed because happy spits out #if __GLASGOW_HASKELL__ >= 710 conditionals
rm "$F2" "$F3"
|