-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve integer literal error messages
Signed-off-by: Nathan Rebours <[email protected]>
- Loading branch information
Showing
4 changed files
with
38 additions
and
16 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,20 +1,32 @@ | ||
open Ppxlib | ||
|
||
let errorf ~loc message = | ||
Location.error_extensionf ~loc "ppx_yojson: %s" message | ||
|
||
let unsupported_payload ~loc = | ||
Location.error_extensionf ~loc "ppx_yojson: unsupported payload" | ||
errorf ~loc "unsupported payload" | ||
|
||
let unsupported_record_field ~loc = | ||
Location.error_extensionf ~loc "ppx_yojson: unsupported record field" | ||
errorf ~loc "unsupported record field" | ||
|
||
let too_many_fields_in_record_pattern ~loc = | ||
Location.error_extensionf ~loc | ||
"ppx_yojson: record patterns with more than 4 fields aren't supported. \ | ||
errorf ~loc | ||
"record patterns with more than 4 fields aren't supported. \ | ||
Consider using ppx_deriving_yojson to handle more complex json objects." | ||
|
||
let bad_expr_antiquotation_payload ~loc = | ||
Location.error_extensionf ~loc | ||
"ppx_yojson: bad antiquotation payload, should be a single expression" | ||
errorf ~loc | ||
"bad antiquotation payload, should be a single expression" | ||
|
||
let bad_pat_antiquotation_payload ~loc = | ||
Location.error_extensionf ~loc | ||
"ppx_yojson: bad antiquotation payload, should be a pattern" | ||
errorf ~loc | ||
"bad antiquotation payload, should be a pattern" | ||
|
||
let invalid_integer_literal_yojson ~loc = | ||
errorf ~loc | ||
"invalid interger literal. Integer literal should fit within \ | ||
an OCaml int or be written in decimal form." | ||
|
||
let invalid_integer_literal_ezjsonm ~loc = | ||
errorf ~loc | ||
"invalid interger literal. Integer literal should fit within an OCaml int." |
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