Skip to content

haskell-indentation mode sometimes can't parse multiline string literals #324

Closed
@kini

Description

@kini

As title. The following code produces parse errors if you hit tab after the last line:

main :: IO ()
main = do
  putStrLn "\
  \foo\
  \bar"

So does this code:

main :: IO ()
main = do
  putStrLn "\
  \foo\
 \bar"

But this code doesn't produce a parse error (though the tab stop produced is a little odd)

main :: IO ()
main = do
  putStrLn "\
  \foo\
   \bar"

Same with all of these code samples:

main :: IO ()
main = do
  putStrLn "\
   \foo\
  \bar"
main :: IO ()
main = do
  putStrLn "\
   \foo\
   \bar"
main :: IO ()
main = do
  putStrLn "\
 \foo\
 \bar"

All the examples above are compiled by GHC without complaint.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions