-
Notifications
You must be signed in to change notification settings - Fork 35
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
docs: exception handler #102
Comments
Ah. This is very complicated, it seems, but I think I found a solution. The issue is @pjmolina Your fix is correct, but it needs to be exported both ways. That is, the generated code should be export const PeggySyntaxError = peggyParser.SyntaxError as typeof _PeggySyntaxError;
export type PeggySyntaxError = _PeggySyntaxError; so that the constructor and the type can both be exported. I think |
Indeed, good catch @siefkenj |
I think PR #103 is ready to fix this. |
I'm not sure this works as intended. I get a TypeScript error from the exception handler. The goal in that handler is being able to call
format()
with type safety.The text was updated successfully, but these errors were encountered: