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

Flags inside pragma #193

Open
georgefst opened this issue Aug 2, 2021 · 3 comments
Open

Flags inside pragma #193

georgefst opened this issue Aug 2, 2021 · 3 comments
Labels

Comments

@georgefst
Copy link
Contributor

In {-# OPTIONS_GHC -F -pgmF tasty-discover -optF --tree-display #-}, the -- is recognised as a comment, and so (at least with my current theme), the remainder of the line is greyed out.

I guess we shouldn't be looking for the single-line comment syntax while we're already inside a multi-line comment.

@sheaf
Copy link
Collaborator

sheaf commented Aug 2, 2021

Thanks for the bug report.

I'm not 100% sure how to proceed, because single line comments are allowed inside {-# LANGUAGE #-} pragmas, for instance. Do we need special logic for OPTIONS_GHC pragmas specifically?

@sheaf sheaf added the bug label Aug 2, 2021
@georgefst
Copy link
Contributor Author

single line comments are allowed inside {-# LANGUAGE #-} pragmas

Eugh, you're right. Seems they're even allowed with OPTIONS_GHC in some cases. I don't know how GHC knows it's not a comment in this case - maybe because -optF has to take an argument.

@neongreen
Copy link

What’s worse, a line comment inside an OPTIONS pragma also negates the closing #-}, so the rest of the file becomes mis-highlighted.

NB: if you special-logic the OPTIONS pragma, please allow anything starting with OPTIONS_, because some Haskell-derived languages like Mu would benefit from this as well.

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

3 participants