Skip to content

haskell-indentation mode can't parse -XDoAndIfThenElse syntax #321

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

Open
kini opened this issue Aug 19, 2014 · 9 comments
Open

haskell-indentation mode can't parse -XDoAndIfThenElse syntax #321

kini opened this issue Aug 19, 2014 · 9 comments

Comments

@kini
Copy link
Contributor

kini commented Aug 19, 2014

As title. The following code compiles and works fine but produces parse errors after the "else":

{-# LANGUAGE DoAndIfThenElse #-}
main :: IO ()
main = do
  if True then
    return ()
  else
    return ()
@gracjan
Copy link
Contributor

gracjan commented Jan 22, 2015

Thanks for the report, this is really annoying me too.
Duplicate of #269.

@kini
Copy link
Contributor Author

kini commented Jan 22, 2015

Is it a duplicate of #269? #269 doesn't seem to mention DoAndIfThenElse.

@gracjan
Copy link
Contributor

gracjan commented Jan 22, 2015

Hmm, I'm not sure anymore. Anyway example in #269 has if..then..else in a do context.

@gracjan
Copy link
Contributor

gracjan commented Apr 4, 2015

haskell-indentation after hi2 merge still exhibits this problem.

@gracjan
Copy link
Contributor

gracjan commented Feb 16, 2016

@kini: Can you add a test case for this in 'tests/haskell-indenttion-tests.el'?

@gracjan gracjan closed this as completed Feb 16, 2016
@ntc2
Copy link
Contributor

ntc2 commented Apr 5, 2017

@gracjan, this is not a duplicate of #269 and should be reopened: Issue #269 is about indenting code in the then and else blocks of an if-then-else (or perhaps indenting do blocks more generally), whereas this current issue is about indenting the then and else keywords themselves.

@ntc2
Copy link
Contributor

ntc2 commented Apr 5, 2017

Here is a related issue I reported on intero-mode, that I guess must actually be due to this current issue in haskell-mode: https://github.com/commercialhaskell/intero/issues/327. I'm going to close that issue since it's not actually Intero's fault.

@gracjan gracjan reopened this Apr 5, 2017
@gracjan
Copy link
Contributor

gracjan commented Apr 5, 2017

Okay, I'll reopen to keep confusion at bay. Since I know the elisp code I also know that handling of if-then-else is broken and both issues are about manifestation of brokeness.

@ntc2
Copy link
Contributor

ntc2 commented Apr 5, 2017

@gracjan, ah, I see. So I guess it could make sense to create a general "if-then-else indentation" is broken issue and close both this and #269, and move all the examples there. I guess an easy way to do this would be to edit one of the issue descriptions and make it more general, instead of actually creating a new issue.

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

3 participants