ormolu/data/examples
Utku Demir 1b818c0064 Correct indentation on string gaps
Haskell strings can have "gaps", where any amount of whitespace between
two backslashes are ignored. This allows writing multi-line strings. As
an example, all strings below are the same:

```
"foobar"
"foo\   \bar"
"foo\

   \bar"
```

When parsing a string literal, lexer usually produces two fields, one
of them is the actual string user wrote as a 'SourceText', the other one
is the sanitized version where gaps and other special characters removed.

While printing the string, GHC's Outputable instance uses the 'SourceText'
field, however since that text contains gaps as-is, we can not change
the original indentation. In order to fix this, this commit splits the
strings by the gaps and print each line separately applying the layout
rules.

Also, it applies the same logic to type-level strings.
2019-09-13 11:26:05 +02:00
..
declaration Correct indentation on string gaps 2019-09-13 11:26:05 +02:00
import Handle comments inside of import statements better 2019-09-12 21:59:43 +02:00
module-header Tweak formatting of warning pragmas 2019-08-09 11:00:06 +02:00
other Better handle multi-line following comments 2019-09-09 11:54:18 +02:00