-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
2,628 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
_build | ||
compile_commands.json | ||
.cache/ |
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 @@ | ||
/home/rymiel/misc/java/lib |
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 |
---|---|---|
|
@@ -14,4 +14,3 @@ | |
(package | ||
(name jvmilia) | ||
(depends ocaml dune)) | ||
|
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,32 @@ | ||
let indent = 2 | ||
let depth = ref 0 | ||
|
||
type entry = string | ||
|
||
let stack = ref [] | ||
let stack_push (v : entry) = stack := v :: !stack | ||
|
||
let stack_pop () : entry = | ||
match !stack with | ||
| [] -> failwith "Debug stack is empty" | ||
| x :: xs -> | ||
stack := xs; | ||
x | ||
|
||
let push (ctx : string) (s : string) : unit = | ||
print_string (String.make (!depth * indent) ' '); | ||
print_string "\027[34m>>\027[0m "; | ||
let prefix = Printf.sprintf "%s: %s" ctx s in | ||
print_string prefix; | ||
print_newline (); | ||
stack_push prefix; | ||
incr depth | ||
|
||
let pop () : unit = | ||
let top = stack_pop () in | ||
decr depth; | ||
print_string (String.make (!depth * indent) ' '); | ||
print_string "\027[34m<<\027[0m "; | ||
print_string top; | ||
print_newline (); | ||
() |
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,2 @@ | ||
val push : string -> string -> unit | ||
val pop : unit -> unit |
Oops, something went wrong.