Skip to content

parse-error "Expecting then" "Expecting else" DoAndIfThenElse in indentation #884

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

Closed
k-bx opened this issue Sep 17, 2015 · 5 comments
Closed

Comments

@k-bx
Copy link
Contributor

k-bx commented Sep 17, 2015

For this code:

main :: IO ()
main = do
    if True
    then putStrLn "True"

when you press enter after "True" – you get an error:

let: No catch for tag: parse-error, "Expecting then"

k-bx added a commit to k-bx/haskell-mode that referenced this issue Sep 17, 2015
@k-bx k-bx mentioned this issue Sep 17, 2015
@k-bx
Copy link
Contributor Author

k-bx commented Sep 17, 2015

Added a PR with a failing test

@gracjan
Copy link
Contributor

gracjan commented Sep 23, 2015

This seems to be an instance of DoAndIfThenElse.

@k-bx
Copy link
Contributor Author

k-bx commented Sep 23, 2015

@gracjan yeah, seems like it. All compilers support it now with no flags needed, so would be nice for haskell-mode to support it, since it feels not right when code compiles, while indentation fails to work.

@gracjan
Copy link
Contributor

gracjan commented Sep 23, 2015

The way this extension is defined with this semicolons out of nowhere is super strange. How to make indentation use this syntax will require some ingenuity.

@gracjan gracjan changed the title let: No catch for tag: parse-error, "Expecting then" parse-error "Expecting then" "Expecting else" DoAndIfThenElse in indentation Oct 6, 2015
@gracjan
Copy link
Contributor

gracjan commented Oct 8, 2015

Actually we have this reported already as #321.

@gracjan gracjan closed this as completed Oct 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants