-
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.
core: add pretty_print_debug / format_debug
- Loading branch information
Showing
8 changed files
with
108 additions
and
42 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
The organization here is a little bit weird. This note explains why. | ||
|
||
The core of the pretty printer is `printer.ml`, and its companion signature file `printer.mli` depends on it. | ||
|
||
In both `printer.ml` and `printer.mli`, we need to specify module types (e.g., `PrinterT`). | ||
However, if we define `PrinterT` in `printer.ml`, then we also need to define it again in `printer.mli`. | ||
|
||
Why don't want to duplicate the module types over and over again. | ||
My solution is to define the module types in a new file `signature.mli`, | ||
and then both `printer.ml` and `printer.mli` can refer to it. | ||
Note that `signature` is specified as `modules_without_implementation` under `dune`, and things work out. | ||
|
||
Stuff that are depended on by `signature.mli` and `printer.ml` are defined in `util.ml`. |
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