Skip to content
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

Fix stripping of leading whitespace from multi-line strings #469

Merged
merged 2 commits into from
Jun 14, 2018

Conversation

Gabriella439
Copy link
Collaborator

Fixes #468

The code to strip leading whitespace was incorrectly computing the leading
whitespace due to incorrectly escaping the string. For example, for the
multi-line string:

''
 foo
bar
''

The code was escaping the newline separating foo and bar and therefore
treating the multi-line string as one long line for dedenting purposes. This
causes the code to incorrectly deduce that there is only one line with one
leading space instead of two lines with a minimum of zero leading spaces.

Fixing the code to not escape the string resolves the problem.

Fixes #468

The code to strip leading whitespace was incorrectly computing the leading
whitespace due to incorrectly escaping the string.  For example, for the
multi-line string:

```haskell
''
 foo
bar
''
```

The code was escaping the newline separating `foo` and `bar` and therefore
treating the multi-line string as one long line for dedenting purposes.  This
causes the code to incorrectly deduce that there is only one line with one
leading space instead of two lines with a minimum of zero leading spaces.

Fixing the code to not escape the string resolves the problem.
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

Successfully merging this pull request may close these issues.

Parser doesn't deal correctly with leading ws in multi-line string literals
1 participant