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
36931fd7
Commit
36931fd7
authored
Aug 27, 2015
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes in calc-inspection/calc.ml, which for some reason did not
even compile.
parent
c1af6807
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
demos/calc-inspection/calc.ml
demos/calc-inspection/calc.ml
+10
-4
No files found.
demos/calc-inspection/calc.ml
View file @
36931fd7
...
...
@@ -105,6 +105,10 @@ module E =
let
terminal2token
=
terminal2token
end
)
let
print_explanation
explanation
=
(* TEMPORARY not satisfactory at all *)
P
.
print_item
explanation
.
MenhirLib
.
ErrorReporting
.
item
(* Initialize the lexer, and catch any exception raised by the lexer. *)
let
process
(
line
:
string
)
=
...
...
@@ -115,11 +119,13 @@ let process (line : string) =
with
|
Lexer
.
Error
msg
->
Printf
.
fprintf
stderr
"%s%!"
msg
|
E
.
Error
explanations
->
|
E
.
Error
((
startp
,
_
)
,
explanations
)
->
Printf
.
fprintf
stderr
"At offset %d: syntax error.
\n
%!"
(
Lexing
.
lexeme_start
lexbuf
);
List
.
iter
P
.
print_item
explanations
"At line %d, column %d: syntax error.
\n
"
startp
.
Lexing
.
pos_lnum
startp
.
Lexing
.
pos_cnum
;
List
.
iter
print_explanation
explanations
;
flush
stderr
(* The rest of the code is as in the [calc] demo. *)
...
...
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