-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In progress: constant_type and special_functions can report multiple…
… errors Signed-off-by: Burnleydev1 <[email protected]>
- Loading branch information
1 parent
0367a68
commit aea4545
Showing
5 changed files
with
67 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
open Ppxlib | ||
|
||
let kind = Context_free.Rule.Constant_kind.Integer | ||
let rewriter loc s = Location.raise_errorf ~loc "rewriter %s failed" s | ||
let rule = Context_free.Rule.constant kind 'g' rewriter;; | ||
|
||
Driver.register_transformation ~rules:[ rule ] "constant" | ||
|
||
let () = Driver.standalone () |
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,8 +1,8 @@ | ||
(executables | ||
(names whole_file_exception whole_file_extension_point | ||
whole_file_located_error extender deriver) | ||
whole_file_located_error extender deriver constant_type special_functions) | ||
(libraries ppxlib)) | ||
|
||
(cram | ||
(deps extender.exe whole_file_exception.exe whole_file_located_error.exe | ||
deriver.exe whole_file_extension_point.exe)) | ||
deriver.exe whole_file_extension_point.exe constant_type.exe special_functions.exe)) |
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,11 @@ | ||
open Ppxlib | ||
|
||
let expand e = | ||
let loc = e.pexp_loc in | ||
Location.raise_errorf ~loc "This is an example error" | ||
|
||
let rule = Context_free.Rule.special_function "n_args" expand | ||
|
||
let () = | ||
Driver.register_transformation ~rules:[ rule ] "special_function_demo"; | ||
Driver.standalone () |