Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alphaLib
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
POTTIER Francois
alphaLib
Commits
6af0a79a
Commit
6af0a79a
authored
Feb 15, 2017
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove [Makefile.preprocess], no longer needed.
parent
03c7271f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
39 deletions
+1
-39
demos/basic/Makefile
demos/basic/Makefile
+1
-1
demos/basic/Makefile.preprocess
demos/basic/Makefile.preprocess
+0
-38
No files found.
demos/basic/Makefile
View file @
6af0a79a
...
...
@@ -20,7 +20,7 @@ test: all
mli
:
@
$(OCAMLBUILD)
$(MLI)
include
Makefile.preprocess
include
$(shell ocamlfind query visitors)/
Makefile.preprocess
processed
:
Term.processed.ml
...
...
demos/basic/Makefile.preprocess
deleted
100644 → 0
View file @
03c7271f
# This Makefile allows running visitors as a preprocessor,
# so as to inspect the generated code and possibly include
# it in a TeX document.
# This assumes the visitors package is installed.
# The rewriting command.
PPX
:=
`
ocamlfind query ppx_deriving
`
/ppx_deriving
\
`
ocamlfind query visitors
`
/ppx_deriving_visitors.cma
REWRITE
:=
ocamlfind ppx_tools/rewriter
-ppx
'
$(PPX)
'
# Use GNU sed to extract the generated code.
# This requires GNU sed 3.95 or above, I am told.
SED
:=
$(
shell
if
command
-v
gsed
>
/dev/null
;
then
echo
gsed
;
else
echo sed
;
fi
)
EXTRACT
:=
$(SED)
-e
'/VISITORS.BEGIN/,/VISITORS.END/!d;//d'
# Use sed to fix some deficiencies of OCaml's code printer.
# 0. Force a space after a comma.
# 1. Replace multiple consecutive spaces with a single space.
# This will destroy indentation; we restore it afterwards.
# 2. Force a line break after [in].
# 3. Force a line break after [->].
# 4. (Ad hoc.) Force a line break between [= let],
# presumably at the beginning of a method definition.
# 5. Remove the line break between [=] and [object].
BEAUTIFY
:=
\
|
$(SED)
-e
's/,/, /g'
\
|
$(SED)
-e
's/ / /g'
\
|
$(SED)
-e
's/ in / in\n/g'
\
|
$(SED)
-e
's/ -> / ->\n/g'
\
|
$(SED)
-e
's/= let /=\nlet /g'
\
| perl
-0777
-pe
's/=\n *object/= object/gs'
\
# Use ocp-indent to beautify the generated code.
INDENT
:=
ocp-indent
--config
=
JaneStreet,match_clause
=
4
%.processed.ml
:
%.ml
$(REWRITE)
$<
|
$(EXTRACT)
$(BEAUTIFY)
|
$(INDENT)
>
$@
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment