diff options
author | 2013-09-22 11:41:26 -0400 | |
---|---|---|
committer | 2013-09-22 11:41:26 -0400 | |
commit | f159e8bccd823a9125f3134fba5a5dc3c7dd7df7 (patch) | |
tree | fc988384db3878204b0b8c957b11fdf6b2491a90 | |
parent | f7c420d9b893197b35da7a15e3384e26ef2d47fd (diff) |
improve lambdaparens hack
-rw-r--r-- | Build/EvilSplicer.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs index d43b16a64..7476e1a0a 100644 --- a/Build/EvilSplicer.hs +++ b/Build/EvilSplicer.hs @@ -332,6 +332,12 @@ mangleCode = flip_colon preindent <- many1 $ oneOf " \n" string "\\ " lambdaparams <- restofline + continuedlambdaparams <- many $ do + indent <- many1 $ char ' ' + p <- satisfy isLetter + aram <- many $ satisfy isAlphaNum <|> oneOf "_" + newline + return $ indent ++ p:aram indent <- many1 $ char ' ' string "-> " firstline <- restofline @@ -342,7 +348,7 @@ mangleCode = flip_colon return $ indent ++ " " ++ l return $ concat [ prefix:preindent - , "(\\ " ++ lambdaparams ++ "\n" + , "(\\ " ++ lambdaparams ++ "\n" ++ intercalate "\n" continuedlambdaparams , indent ++ "-> " , lambdaparens $ intercalate "\n" (firstline:lambdalines) , ")\n" |