You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix parser swallowing whitespace in Src annotations (#1563)
* Fix swallowed whitespace in Src annotations
The parser annotated application expressions incorrectly: whitespace
between function and argument was swallowed when constructing the Src
annotation. This bug resulted in strange behaviour in the hovering
functionality in dhall-lsp-server.
As an example, previously the Dhall expression `0 0` would be parsed as
```
Note (Src {..., srcText = "00"})
(App (Note (Src {..., srcText = "0"}) (NaturalLit 0))
(Note (Src {..., srcText = "0"}) (NaturalLit 0)))
```
while we now get
```
Note (Src {..., srcText = "0 0"})
(App (Note (Src {..., srcText = "0"}) (NaturalLit 0))
(Note (Src {..., srcText = "0"}) (NaturalLit 0)))
```
as expected.
* Use foldl' over foldl
As suggested by @sjakobi. Note that there are quite a few more
occurences of foldl where we don't actually need laziness, but I leave
that for someone else to fix :)
* Revert "Use foldl' over foldl"
This reverts commit 1bd9a54.
0 commit comments