-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: factor out text handling as new modules
- Loading branch information
Showing
20 changed files
with
208 additions
and
130 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
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 @@ | ||
type t = Text.t Range.located | ||
|
||
let make ?loc s : t = Range.locate_opt loc @@ Text.make s | ||
|
||
let kmakef ?loc k = Text.kmakef @@ fun t -> k @@ Range.locate_opt loc t | ||
|
||
let makef ?loc = Text.kmakef @@ Range.locate_opt loc |
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,23 @@ | ||
(** {1 Types} *) | ||
|
||
(** A located text *) | ||
type t = Text.t Range.located | ||
|
||
(** {1 Builders} *) | ||
|
||
(** [make str] converts the string [str] into a located text. | ||
@param loc The location of the text (usually the code) to highlight. *) | ||
val make : ?loc:Range.t -> string -> t | ||
|
||
(** [makef format ...] constructs a located text. Note that there should not be any literal control characters (e.g., literal newline characters). | ||
@param loc The location of the text (usually the code) to highlight. | ||
*) | ||
val makef : ?loc:Range.t -> ('a, Format.formatter, unit, t) format4 -> 'a | ||
|
||
(** [kmakef kont format ...] is [kont (makef format ...)]. | ||
@param loc The location of the text (usually the code) to highlight. | ||
*) | ||
val kmakef : ?loc:Range.t -> (t -> 'b) -> ('a, Format.formatter, unit, 'b) format4 -> 'a |
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.