Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
menhir
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
11
Issues
11
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POTTIER Francois
menhir
Commits
a01e0cf0
Commit
a01e0cf0
authored
Oct 19, 2018
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update demos/calc-incremental-dune.
parent
0ee21ba9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
25 deletions
+28
-25
demos/calc-incremental-dune/Makefile
demos/calc-incremental-dune/Makefile
+1
-1
demos/calc-incremental-dune/README
demos/calc-incremental-dune/README
+0
-3
demos/calc-incremental-dune/README.md
demos/calc-incremental-dune/README.md
+2
-0
demos/calc-incremental-dune/calc.ml
demos/calc-incremental-dune/calc.ml
+5
-4
demos/calc-incremental-dune/dune
demos/calc-incremental-dune/dune
+13
-0
demos/calc-incremental-dune/dune-project
demos/calc-incremental-dune/dune-project
+2
-0
demos/calc-incremental-dune/jbuild
demos/calc-incremental-dune/jbuild
+0
-13
demos/calc-incremental/calc.ml
demos/calc-incremental/calc.ml
+5
-4
No files found.
demos/calc-incremental-dune/Makefile
View file @
a01e0cf0
.PHONY
:
all clean test
DUNE
:=
jbuilder
DUNE
:=
dune
EXECUTABLE
:=
calc.exe
all
:
...
...
demos/calc-incremental-dune/README
deleted
100644 → 0
View file @
0ee21ba9
This demo is identical to the "calc-incremental" demo,
but uses dune (a.k.a. jbuilder)
instead of ocamlbuild.
demos/calc-incremental-dune/README.md
0 → 100644
View file @
a01e0cf0
This demo is identical to the
`calc-incremental`
demo
but uses dune instead of ocamlbuild.
demos/calc-incremental-dune/calc.ml
View file @
a01e0cf0
...
...
@@ -14,7 +14,7 @@ module I =
let
rec
loop
lexbuf
(
checkpoint
:
int
I
.
checkpoint
)
=
match
checkpoint
with
|
I
.
InputNeeded
env
->
|
I
.
InputNeeded
_
env
->
(* The parser needs a token. Request one from the lexer,
and offer it to the parser, which will produce a new
checkpoint. Then, repeat. *)
...
...
@@ -27,7 +27,7 @@ let rec loop lexbuf (checkpoint : int I.checkpoint) =
|
I
.
AboutToReduce
_
->
let
checkpoint
=
I
.
resume
checkpoint
in
loop
lexbuf
checkpoint
|
I
.
HandlingError
env
->
|
I
.
HandlingError
_
env
->
(* The parser has suspended itself because of a syntax error. Stop. *)
Printf
.
fprintf
stderr
"At offset %d: syntax error.
\n
%!"
...
...
@@ -40,6 +40,8 @@ let rec loop lexbuf (checkpoint : int I.checkpoint) =
we stop as soon as the parser reports [HandlingError]. *)
assert
false
let
_
=
loop
(* silence OCaml's unused-value warning about [loop] *)
(* -------------------------------------------------------------------------- *)
(* The above loop is shown for explanatory purposes, but can in fact be
...
...
@@ -89,7 +91,6 @@ let rec repeat channel =
process
optional_line
;
if
continue
then
repeat
channel
let
()
=
repeat
(
from_channel
stdin
)
demos/calc-incremental-dune/dune
0 → 100644
View file @
a01e0cf0
(ocamllex
(modules lexer)
)
(menhir
(modules parser)
(flags ("--table"))
)
(executable
(name calc)
(libraries menhirLib)
)
demos/calc-incremental-dune/dune-project
0 → 100644
View file @
a01e0cf0
(lang dune 1.4)
(using menhir 2.0)
demos/calc-incremental-dune/jbuild
deleted
100644 → 0
View file @
0ee21ba9
(jbuild_version 1)
(ocamllex (lexer))
(menhir (
(modules (parser))
(flags ("--table"))
))
(executable (
(name calc)
(libraries (menhirLib))
))
demos/calc-incremental/calc.ml
View file @
a01e0cf0
...
...
@@ -14,7 +14,7 @@ module I =
let
rec
loop
lexbuf
(
checkpoint
:
int
I
.
checkpoint
)
=
match
checkpoint
with
|
I
.
InputNeeded
env
->
|
I
.
InputNeeded
_
env
->
(* The parser needs a token. Request one from the lexer,
and offer it to the parser, which will produce a new
checkpoint. Then, repeat. *)
...
...
@@ -27,7 +27,7 @@ let rec loop lexbuf (checkpoint : int I.checkpoint) =
|
I
.
AboutToReduce
_
->
let
checkpoint
=
I
.
resume
checkpoint
in
loop
lexbuf
checkpoint
|
I
.
HandlingError
env
->
|
I
.
HandlingError
_
env
->
(* The parser has suspended itself because of a syntax error. Stop. *)
Printf
.
fprintf
stderr
"At offset %d: syntax error.
\n
%!"
...
...
@@ -40,6 +40,8 @@ let rec loop lexbuf (checkpoint : int I.checkpoint) =
we stop as soon as the parser reports [HandlingError]. *)
assert
false
let
_
=
loop
(* silence OCaml's unused-value warning about [loop] *)
(* -------------------------------------------------------------------------- *)
(* The above loop is shown for explanatory purposes, but can in fact be
...
...
@@ -89,7 +91,6 @@ let rec repeat channel =
process
optional_line
;
if
continue
then
repeat
channel
let
()
=
repeat
(
from_channel
stdin
)
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