-
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.
Return the roll value as a string in the JS interface
- Loading branch information
Showing
2 changed files
with
8 additions
and
3 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,10 +1,14 @@ | ||
open Main | ||
|
||
let toString ival = match ival with | ||
Some x -> Main.stringIVal x | ||
| None -> "" | ||
|
||
module Javascript = | ||
struct | ||
let () = | ||
Js.export_all | ||
(object%js | ||
method run src = Main.main (Lexing.from_string (Js.to_string src)) 1 (Some 1) | ||
method run src = toString (Main.run (Lexing.from_string (Js.to_string src)) 1 (fun d -> d)) | ||
end) | ||
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