Open
Description
I'd like to work on this, but currently the Lam
and Pi
constructor don't have the Src
or SourcePos
of the parsed label.
There are two ways to solve this:
- Record the whitespace on
Lam
andPi
bindings similar to what we do onBinding
. This will help in the context of dhall-format removes comments #145
The new constructors would look roughly like this:data FunctionBinding = FunctionBinding {...} data Expr s a = ... | Lam (Maybe s, Text) (Expr s a) (Expr s a) | Pi (Maybe s, Text) (Expr s a) (Expr s a) ....
- Use the parent
Note
Src
of theLam
orPi
expression and run a parser to get the relative location of the label in the src and add it to thesrcStart
. This would only affectdhall-docs
and it's somewhat similar to howdhall-lsp-server
computes the source spans for source code messages.
What do you think is the best way to tackle this? cc: @sjakobi @Gabriel439 @Profpatsch