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
Raphaël Cauderlier
Sigmaid
Commits
28c462e5
Commit
28c462e5
authored
Jul 01, 2014
by
Raphaël Cauderlier
Browse files
Handle parsing errors
parent
9e80fb3c
Changes
2
Show whitespace changes
Inline
Side-by-side
scoper.mli
View file @
28c462e5
open
Parsetree
exception
Unknown_type_variable
of
cid
exception
Unknown_variable
of
id
type
sty
=
|
Stcid
of
cid
*
sty
|
Stlist
of
(
label
*
sty
)
list
...
...
sigmaid.ml
View file @
28c462e5
...
...
@@ -24,7 +24,13 @@ let main () =
let
lexbuf
=
Lexing
.
from_channel
input
in
let
out_fmter
=
Format
.
std_formatter
in
let
prog
=
lex_prog
lexbuf
in
let
scoped_prog
=
Scoper
.
scope
prog
in
let
scoped_prog
=
try
Scoper
.
scope
prog
with
Scoper
.
Unknown_variable
id
->
Format
.
eprintf
"Scope error: unknown variable %s@."
(
Scoper
.
string_of_id
id
);
exit
1
in
let
typed_prog
=
Typer
.
type_check
scoped_prog
in
Format
.
fprintf
out_fmter
"#NAME %s.@
\n
"
(
Filename
.
chop_extension
file
);
Printer
.
declare_labels
out_fmter
!
Base
.
labels
;
...
...
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