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

hindent fails on #include #430

Closed
phadej opened this issue Jul 14, 2017 · 3 comments
Closed

hindent fails on #include #430

phadej opened this issue Jul 14, 2017 · 3 comments

Comments

@phadej
Copy link
Contributor

phadej commented Jul 14, 2017

% cat include.hs 
#include "something-compat.h"

module Foo where

% cat include.hs| hindent
hindent: <interactive>: 3: 1: Parse error: module
CallStack (from HasCallStack):
  error, called at src/main/Main.hs:62:21 in main:Main

Are #includes handled at all?

@phadej
Copy link
Contributor Author

phadej commented Jul 14, 2017

Maybe adding #include to https://github.com/commercialhaskell/hindent/blob/d43b1fd40b8054a7122705dd44efcb4f86b37416/src/HIndent.hs#L179
will fix the bug by splitting the source into two blocks with #include in between.

@sighingnow
Copy link
Collaborator

Put the #include pragma after the module line would work:

module Foo where

#include "something-compat.h"

@sighingnow
Copy link
Collaborator

Seems an issue related to HSE, see haskell-suite/haskell-src-exts#68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants