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
100ffcad
Commit
100ffcad
authored
Jun 27, 2014
by
Raphaël Cauderlier
Browse files
Error handling
parent
50d9637e
Changes
1
Hide whitespace changes
Inline
Side-by-side
sigmaid.ml
View file @
100ffcad
...
...
@@ -5,7 +5,8 @@ let print_pos lb =
let
cnum
=
start
.
Lexing
.
pos_cnum
-
start
.
Lexing
.
pos_bol
in
let
tok
=
Lexing
.
lexeme
lb
in
Format
.
eprintf
"File: %s, line: %d, column: %d, Token
\"
%s
\"
@
\n
@."
file
line
cnum
tok
file
line
cnum
tok
;
exit
1
let
rec
lex_prog
lb
=
try
...
...
@@ -13,8 +14,8 @@ let rec lex_prog lb =
let
lines
=
lex_prog
lb
in
(
pos
,
line
)
::
lines
with
End_of_file
->
[]
|
Pars
ing
.
Parse_e
rror
->
print_pos
lb
;
[]
|
Pars
er
.
E
rror
->
print_pos
lb
let
main
()
=
Arg
.
parse
[]
(
fun
file
->
...
...
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