Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
menhir
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POTTIER Francois
menhir
Commits
c8d6f737
Commit
c8d6f737
authored
Dec 26, 2014
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup in Printer.
parent
553d9454
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
23 deletions
+28
-23
src/printer.ml
src/printer.ml
+28
-23
No files found.
src/printer.ml
View file @
c8d6f737
...
...
@@ -458,7 +458,7 @@ and pat2 f = function
|
POr
[]
->
assert
false
|
POr
(
_
::
_
as
ps
)
->
fprintf
f
"%a"
(
seplist
pat2
bar
)
ps
seplist
pat2
bar
f
ps
|
PTuple
[
p
]
->
pat2
f
p
|
p
->
...
...
@@ -609,16 +609,30 @@ let excdef in_intf f def =
let
excdefs
in_intf
=
pdefs
(
excdef
in_intf
)
exc
exc
let
block
format
body
f
b
=
fprintf
f
format
(
indent
2
(
fun
f
b
->
nl
f
;
body
f
b
)
)
b
let
structend
body
f
b
=
block
"struct%aend"
body
f
b
let
sigend
body
f
b
=
block
"sig%aend"
body
f
b
let
functorparams
intf
body
b
f
params
=
match
params
with
|
[]
->
fprintf
f
"%a%!"
body
b
body
f
b
|
_
->
fprintf
f
"module Make%a%t%s
%t%a%t%tend%t%!
"
fprintf
f
"module Make%a%t%s
%a%t
"
(
list
(
stretch
false
)
nl
)
params
nl
(
if
intf
then
":
sig"
else
"= struct"
)
nl
(
i
ndent
2
body
)
b
nl
nl
nl
nl
(
if
intf
then
":
"
else
"="
)
(
i
f
intf
then
sigend
body
else
structend
body
)
b
nl
let
structure_item
f
=
function
|
SIExcDefs
defs
->
...
...
@@ -635,13 +649,7 @@ let rec modexpr f = function
|
MVar
x
->
fprintf
f
"%s"
x
|
MStruct
s
->
fprintf
f
"struct%aend"
(
indent
2
(
fun
f
s
->
fprintf
f
"%t%a"
nl
structure
s
)
)
s
structend
structure
f
s
|
MApp
(
e1
,
e2
)
->
fprintf
f
"%a (%a)"
modexpr
e1
modexpr
e2
...
...
@@ -676,13 +684,7 @@ let rec module_type f = function
module_type
mt
(
indent
2
with_type
)
(
name
,
wk
,
t
)
|
MTSigEnd
i
->
fprintf
f
"sig%aend"
(
indent
2
(
fun
f
i
->
fprintf
f
"%t%a"
nl
interface
i
)
)
i
sigend
interface
f
i
and
with_type
f
(
name
,
wk
,
t
)
=
fprintf
f
"with type %s %a %a"
...
...
@@ -710,12 +712,15 @@ and interface f i =
list
interface_item
nothing
f
i
let
program
p
=
functorparams
false
program
p
X
.
f
p
.
paramdefs
functorparams
false
program
p
X
.
f
p
.
paramdefs
;
flush
X
.
f
let
interface
i
=
interface
X
.
f
i
interface
X
.
f
i
;
flush
X
.
f
let
expr
e
=
expr
X
.
f
e
expr
X
.
f
e
;
flush
X
.
f
end
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