-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #446 from panglesd/exec-included-blocks
Allow execution of included OCaml code blocks
- Loading branch information
Showing
12 changed files
with
201 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(* $MDX part-begin=OK *) | ||
let f x = x + 1 | ||
(* $MDX part-end *) | ||
|
||
(* $MDX part-begin=KO *) | ||
let k = x = 1 | ||
(* $MDX part-end *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
val f : int -> int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.mli files are included but not executed: | ||
<!-- $MDX file=code.mli --> | ||
```ocaml | ||
val f : int -> int | ||
``` | ||
|
||
.mli files are still included when `skip` is used: | ||
<!-- $MDX file=code.mli,skip --> | ||
```ocaml | ||
val f : int -> int | ||
``` | ||
|
||
.ml files are included and executed: | ||
<!-- $MDX file=code.ml,part=OK --> | ||
```ocaml | ||
let f x = x + 1 | ||
``` | ||
|
||
<!-- $MDX file=code.ml,part=KO --> | ||
```ocaml | ||
let k = x = 1 | ||
``` | ||
```mdx-error | ||
Line 1, characters 9-10: | ||
Error: Unbound value x | ||
``` | ||
|
||
|
||
.ml files are still included but no longer executed when `skip` is used: | ||
<!-- $MDX file=code.ml,part=OK,skip --> | ||
```ocaml | ||
let f x = x + 1 | ||
``` | ||
|
||
<!-- $MDX file=code.ml,part=KO,skip --> | ||
```ocaml | ||
let k = x = 1 | ||
``` |
Oops, something went wrong.