-
Notifications
You must be signed in to change notification settings - Fork 182
Top level printers for the main cohttp types #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f6c14a7
add pp_hum printers to header/request/response
rgrinberg 71cc829
add Cohttp_top module to install toplevel printers
rgrinberg 4a867c5
add cohttp.top lib to install printers
rgrinberg 4873bd6
regenerate oasis
rgrinberg 457eb5f
add compiler libs to .merlin
rgrinberg 2c9cdd8
Sexp.to_string -> Sexp.to_string_hum
rgrinberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
| let printers = [ "Cohttp.Header.pp_hum" | ||
| ; "Cohttp.Request.pp_hum" | ||
| ; "Cohttp.Response.pp_hum" ] | ||
|
|
||
| let eval_string | ||
| ?(print_outcome = false) ?(err_formatter = Format.err_formatter) str = | ||
| let lexbuf = Lexing.from_string str in | ||
| let phrase = !Toploop.parse_toplevel_phrase lexbuf in | ||
| Toploop.execute_phrase print_outcome err_formatter phrase | ||
|
|
||
| let rec install_printers = function | ||
| | [] -> true | ||
| | printer :: printers -> | ||
| let cmd = Printf.sprintf "#install_printer %s;;" printer in | ||
| eval_string cmd && install_printers printers | ||
|
|
||
| let () = | ||
| if not (install_printers printers) then | ||
| Format.eprintf "Problem installing Cohttp-printers@." | ||
|
|
||
This file contains hidden or 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,4 @@ | ||
| # OASIS_START | ||
| # DO NOT EDIT (digest: 2f82f537ac3c3eae3961f1001930e9e6) | ||
| Cohttp_top | ||
| # OASIS_STOP |
This file contains hidden or 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,4 @@ | ||
| # OASIS_START | ||
| # DO NOT EDIT (digest: 2f82f537ac3c3eae3961f1001930e9e6) | ||
| Cohttp_top | ||
| # OASIS_STOP |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a much simpler scheme to do this which is to write the installation bits in a source
PKG_top_init.mlfile and simply have a libraryPKG_topwith a call toToploop.use_file. The advantage is that it's easier to test that the init works before making a release if you wish, you get good error reporting and you don'tsprintfcode which is kind of ugly.You can have a look at
gg_topandgg_top_init.mlormtime_topandmtime_top_init.ml.