aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-01-14 09:24:11 +0100
committerMike McQuaid2015-01-14 12:33:23 +0000
commit036da097cfc54c30fd63793c336547ea7466c809 (patch)
tree263cb0074744249ad7e8bb5de08122fc8f71f4be /Library
parente1e003acb615c5e784713a6a94c2b2f1c9c9f3af (diff)
downloadhomebrew-036da097cfc54c30fd63793c336547ea7466c809.tar.bz2
menhir 20141215
Closes #35862. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/menhir.rb32
1 files changed, 26 insertions, 6 deletions
diff --git a/Library/Formula/menhir.rb b/Library/Formula/menhir.rb
index ce50855ec..d385aa0d3 100644
--- a/Library/Formula/menhir.rb
+++ b/Library/Formula/menhir.rb
@@ -1,15 +1,35 @@
-require "formula"
-
class Menhir < Formula
homepage "http://cristal.inria.fr/~fpottier/menhir"
- url "http://cristal.inria.fr/~fpottier/menhir/menhir-20140422.tar.gz"
- sha1 "1f8980f1436f162c8abed990ade51f0e9433f7a2"
+ url "http://cristal.inria.fr/~fpottier/menhir/menhir-20141215.tar.gz"
+ sha1 "0aa5d58a5cdf0daa69bb577daf379997dc3af1c1"
depends_on "objective-caml"
def install
ENV.deparallelize
- system "make", "PREFIX=#{prefix}", "all"
- system "make", "PREFIX=#{prefix}", "install"
+ system "make", "PREFIX=#{prefix}", "all", "install"
+ end
+
+ test do
+ (testpath/"test.mly").write <<-EOS.undent
+ %token PLUS TIMES EOF
+ %left PLUS
+ %left TIMES
+ %token<int> INT
+ %start<int> prog
+ %%
+
+ prog: x=exp EOF { x }
+
+ exp: x = INT { x }
+ | lhs = exp; op = op; rhs = exp { op lhs rhs }
+
+ %inline op: PLUS { fun x y -> x + y }
+ | TIMES { fun x y -> x * y }
+ EOS
+
+ system "#{bin}/menhir", "--dump", "--explain", "--infer", "test.mly"
+ assert File.exist? "test.ml"
+ assert File.exist? "test.mli"
end
end