Skip to content
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

Add flag -raise-embedded-errors to Driver #559

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jaymody
Copy link

@jaymody jaymody commented Feb 5, 2025

Adds a flag -raise-embedded-errors to the shared args in Driver, which will raise the first ocaml.error node found in the processed AST.

Motivation

It's useful to be able to run a standalone ppx driver for it's side affects (e.g. registering correction files), without actually making use of it's output directly.

For example, given the program program.ml:

type t = int [@@deriving_inline my_deriver]

One might run:

$ my_ppx.exe program.ml -null

With the objective of registering a correction file while ignoring any output. However, since errors are embedded into the AST, the error [%%ocaml.error "ppxlib: [@@@deriving.end] attribute missing"] never gets surfaced to the users. Now it can be, with -raise-embedded-errors.

…edded ocaml.error in the processed AST.

Signed-off-by: Jay Mody <[email protected]>
@jaymody jaymody force-pushed the raise-embedded-errors branch from 5e4a42e to 6fcb29a Compare February 5, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant