Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
fb4e2007
Commit
fb4e2007
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2002-10-20 19:49:59 by cvscast] Empty log message
Original author: cvscast Date: 2002-10-20 19:49:59+00:00
parent
b5e0d473
Changes
1
Hide whitespace changes
Inline
Side-by-side
driver/cduce.ml
View file @
fb4e2007
open
Location
open
Sys
exception
Usage
of
unit
let
()
=
List
.
iter
(
fun
(
n
,
t
)
->
Typer
.
register_global_types
[
n
,
mk
noloc
(
Ast
.
Internal
t
)])
Builtin
.
types
let
input
=
Stream
.
of_channel
stdin
let
input
=
if
(
Array
.
length
argv
>
2
)
or
not
(
file_exists
(
Array
.
get
argv
1
))
then
raise
(
Usage
()
)
else
if
Array
.
length
argv
=
1
then
(
Stream
.
of_channel
stdin
)
else
(
Stream
.
of_channel
(
open_in
(
Array
.
get
argv
1
)))
let
ppf
=
Format
.
std_formatter
let
prog
()
=
try
Parser
.
prog
input
with
|
Stdpp
.
Exc_located
(
loc
,
e
)
->
raise
(
Location
(
loc
,
e
))
|
Stdpp
.
Exc_located
(
loc
,
e
)
->
raise
(
Location
(
loc
,
e
))
let
rec
print_exn
ppf
=
function
|
Location
((
i
,
j
)
,
exn
)
->
...
...
@@ -60,3 +66,7 @@ let () =
List
.
iter
phrase
p
with
(
Failure
_
)
as
e
->
raise
e
|
exn
->
print_exn
ppf
exn
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