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
C
cfml
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CHARGUERAUD Arthur
cfml
Commits
ae3d83a6
Commit
ae3d83a6
authored
Jan 07, 2016
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pretty-printing width is now configurable, default is 80.
parent
8d4d446d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
generator/main.ml
generator/main.ml
+16
-10
generator/print_coq.ml
generator/print_coq.ml
+2
-2
No files found.
generator/main.ml
View file @
ae3d83a6
...
@@ -24,6 +24,21 @@ let outputfile = ref None
...
@@ -24,6 +24,21 @@ let outputfile = ref None
(*#########################################################################*)
(*#########################################################################*)
let
spec
=
Arg
.
align
[
(
"-I"
,
Arg
.
String
(
fun
i
->
Clflags
.
include_dirs
:=
i
::!
Clflags
.
include_dirs
)
,
" includes a directory where to look for interface files"
);
(
"-pure"
,
Arg
.
Set
Characteristic
.
pure_mode
,
" generate formulae for purely-functional code"
);
(
"-rectypes"
,
Arg
.
Set
Clflags
.
recursive_types
,
" activates recursive types"
);
(
"-credits"
,
Arg
.
Set
Characteristic
.
use_credits
,
" generate 'pay' instructions"
);
(
"-nostdlib"
,
Arg
.
Set
no_mystd_include
,
" do not include standard library"
);
(
"-nopervasives"
,
Arg
.
Set
Clflags
.
nopervasives
,
" do not include standard pervasives file"
);
(
"-o"
,
Arg
.
String
(
fun
s
->
outputfile
:=
Some
s
)
,
" set the output file name"
);
(
"-onlycmj"
,
Arg
.
Set
onlycmj
,
" only generate the .cmj file, not the .v file"
);
(
"-debug"
,
Arg
.
Set
is_tracing
,
" trace the various steps"
);
(
"-width"
,
Arg
.
Set_int
Print_coq
.
width
,
" set pretty-printing width for the .v file"
);
]
let
_
=
let
_
=
Settings
.
configure
()
;
Settings
.
configure
()
;
...
@@ -31,16 +46,7 @@ let _ =
...
@@ -31,16 +46,7 @@ let _ =
trace
"1) parsing of command line"
;
trace
"1) parsing of command line"
;
let
files
=
ref
[]
in
let
files
=
ref
[]
in
Arg
.
parse
Arg
.
parse
[
(
"-I"
,
Arg
.
String
(
fun
i
->
Clflags
.
include_dirs
:=
i
::!
Clflags
.
include_dirs
)
,
spec
"includes a directory where to look for interface files"
);
(
"-pure"
,
Arg
.
Set
Characteristic
.
pure_mode
,
"generate formulae for purely-functional code"
);
(
"-rectypes"
,
Arg
.
Set
Clflags
.
recursive_types
,
"activates recursive types"
);
(
"-credits"
,
Arg
.
Set
Characteristic
.
use_credits
,
"generate 'pay' instructions"
);
(
"-nostdlib"
,
Arg
.
Set
no_mystd_include
,
"do not include standard library"
);
(
"-nopervasives"
,
Arg
.
Set
Clflags
.
nopervasives
,
"do not include standard pervasives file"
);
(
"-o"
,
Arg
.
String
(
fun
s
->
outputfile
:=
Some
s
)
,
"set the output file name"
);
(
"-onlycmj"
,
Arg
.
Set
onlycmj
,
"only generate the cmj file, not the coq file"
);
(
"-debug"
,
Arg
.
Set
is_tracing
,
"trace the various steps"
)
]
(
fun
f
->
files
:=
f
::!
files
)
(
fun
f
->
files
:=
f
::!
files
)
(
"usage: [-I dir] [..other options..] file.ml"
);
(
"usage: [-I dir] [..other options..] file.ml"
);
(*
(*
...
...
generator/print_coq.ml
View file @
ae3d83a6
...
@@ -19,7 +19,7 @@ let indentation =
...
@@ -19,7 +19,7 @@ let indentation =
2
2
let
width
=
let
width
=
80
ref
80
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
...
@@ -442,5 +442,5 @@ let tops ts =
...
@@ -442,5 +442,5 @@ let tops ts =
(* The main entry point translates a list of toplevel elements to a string. *)
(* The main entry point translates a list of toplevel elements to a string. *)
let
tops
ts
:
string
=
let
tops
ts
:
string
=
run
(
PPrintEngine
.
ToBuffer
.
pretty
0
.
9
width
)
(
tops
ts
)
run
(
PPrintEngine
.
ToBuffer
.
pretty
0
.
9
!
width
)
(
tops
ts
)
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