-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Allow printer registration in prepare/prelude & Fix print callba…
…cks' usage
- Loading branch information
Showing
22 changed files
with
297 additions
and
186 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include Introspection_intf.LEARNOCAML_CALLBACK | ||
include Learnocaml_internal_intf.CALLBACKS |
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,4 +1,4 @@ | ||
(* This interface is used to pre-compile modules for the toplevel, giving them | ||
access to specific toplevel functions. It should not be made accessible to | ||
the non-precompiled code running in the toplevel *) | ||
include Learnocaml_internal_intf.S | ||
include Learnocaml_internal_intf.INTERNAL |
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,2 @@ | ||
let () = | ||
Ppxlib.Driver.register_transformation "print_recorder" ~impl:Printer_recorder.expand |
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 @@ | ||
let () = | ||
Migrate_parsetree.Driver.run_main ~exit_on_error:true () |
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,13 @@ | ||
include Ppx_autoregister.Make(struct | ||
let val_prefix = "print" | ||
let inject_def id name var = | ||
let open Ppxlib in | ||
let open Ast_builder.Default in | ||
let loc = var.Location.loc in | ||
pexp_apply ~loc | ||
(evar ~loc "Learnocaml_internal.install_printer") | ||
[ Nolabel, estring ~loc (Ppx_autoregister.modname var); | ||
Nolabel, estring ~loc id; | ||
Nolabel, estring ~loc name; | ||
Nolabel, evar ~loc var.txt ] | ||
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 expand: Ppxlib.structure -> Ppxlib.structure |
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,13 @@ | ||
include Ppx_autoregister.Make(struct | ||
let val_prefix = "sample" | ||
let inject_def id name var = | ||
let open Ppxlib in | ||
let open Ast_builder.Default in | ||
let loc = var.Location.loc in | ||
pexp_apply ~loc | ||
(evar ~loc "Introspection.register_sampler") | ||
[ Nolabel, estring ~loc (Ppx_autoregister.modname var); | ||
Nolabel, estring ~loc id; | ||
Nolabel, estring ~loc name; | ||
Nolabel, evar ~loc var.txt] | ||
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 expand: Ppxlib.structure -> Ppxlib.structure |
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
Oops, something went wrong.