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

Grammar does not support GHC 8.6 source plugins #21

Closed
patrickt opened this issue Nov 2, 2018 · 3 comments
Closed

Grammar does not support GHC 8.6 source plugins #21

patrickt opened this issue Nov 2, 2018 · 3 comments
Labels

Comments

@patrickt
Copy link
Contributor

patrickt commented Nov 2, 2018

If we find a {-# OPTIONS -fplugin=SomePlugin #-} pragma atop a source file, we should bail out (or take some other appropriate action), as GHC source plugins can run arbitrary transformations on source code. An example of source-plugin-modified code that we can’t parse (without pulling in the plugin architecture, which is of course out of scope for a plain parser) can be found here.

@tek
Copy link
Contributor

tek commented Mar 3, 2021

The code in that post still looks like valid syntax to me. Are you sure using plugins allows you to write syntactically invalid code?

In any case, since you a) can use a plugin by putting it in the cabal config and b) some plugins only do type inference support (e.g. polysemy-plugin), I think this isn't feasible.

@patrickt
Copy link
Contributor Author

patrickt commented Mar 3, 2021

@tek Yeah, that’s a good point. I suppose when I said ‘parse’ in this case I meant ‘parse to what is meant by the user’, rather than ‘yield a parse tree’—kind of an unhelpful formulation. And yeah, regardless of whether a plugin allows you to write syntactically invalid code, this is still a WONTFIX situation.

@tek
Copy link
Contributor

tek commented Mar 3, 2021

ok!

@tek tek closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants