-
Notifications
You must be signed in to change notification settings - Fork 76
/
dune
32 lines (29 loc) · 1.57 KB
/
dune
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;**************************************************************************
;* *
;* OCaml *
;* *
;* Thomas Refis, Jane Street Europe *
;* *
;* Copyright 2018 Jane Street Group LLC *
;* *
;* All rights reserved. This file is distributed under the terms of *
;* the GNU Lesser General Public License version 2.1, with the *
;* special exception on linking described in the file LICENSE. *
;* *
;**************************************************************************
(rule
(targets camlinternalMenhirLib.ml)
(action
(with-stdout-to %{targets}
;; Partial applications of the form Obj.magic f x in menhirLib cause
;; an issue with locals, so rewrite these to Obj.magic (f x)
(bash "cat $(menhir --suggest-menhirLib)/menhirLib.ml |
sed 's/\\b\\(in\\|then\\|with\\|else\\)\\b/@@@\\1/g; s/Obj.magic \\([a-z0-9_]\\+\\( [a-z0-9_]\\+\\)\\+\\)/Obj.magic (\\1)/g; s/@@@//g'"))))
(rule
(targets camlinternalMenhirLib.mli)
(action
(with-stdout-to %{targets}
(bash "cat $(menhir --suggest-menhirLib)/menhirLib.mli"))))
(ocamllex
(modules lexer)
(mode fallback))