better fix
This commit is contained in:
parent
dd715b5993
commit
a88b5e7786
1 changed files with 5 additions and 4 deletions
|
@ -491,12 +491,13 @@ mangleCode = flip_colon
|
||||||
- a line:
|
- a line:
|
||||||
-
|
-
|
||||||
- forall foo =>
|
- forall foo =>
|
||||||
- Foo ->
|
- Foo ->
|
||||||
-
|
-
|
||||||
- To detect and avoid these, note that ghc puts 2 spaces
|
- To avoid breaking these, look for the => on the previous line.
|
||||||
- before the "->"
|
|
||||||
-}
|
-}
|
||||||
case_layout = parsecAndReplace $ do
|
case_layout = parsecAndReplace $ do
|
||||||
|
void newline
|
||||||
|
lastline <- restOfLine
|
||||||
void newline
|
void newline
|
||||||
indent1 <- many1 $ char ' '
|
indent1 <- many1 $ char ' '
|
||||||
prefix <- manyTill (noneOf "\n") (try (string "-> "))
|
prefix <- manyTill (noneOf "\n") (try (string "-> "))
|
||||||
|
@ -506,7 +507,7 @@ mangleCode = flip_colon
|
||||||
then unexpected "lambda expression"
|
then unexpected "lambda expression"
|
||||||
else if null prefix
|
else if null prefix
|
||||||
then unexpected "second line of lambda"
|
then unexpected "second line of lambda"
|
||||||
else if " " `isSuffixOf` prefix
|
else if "=>" `isSuffixOf` lastline
|
||||||
then unexpected "probably type signature"
|
then unexpected "probably type signature"
|
||||||
else return $ "\n" ++ indent1 ++ "; " ++ prefix ++ " -> "
|
else return $ "\n" ++ indent1 ++ "; " ++ prefix ++ " -> "
|
||||||
{- Sometimes cases themselves span multiple lines:
|
{- Sometimes cases themselves span multiple lines:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue