-
Notifications
You must be signed in to change notification settings - Fork 710
Source-location aware parser for package descriptions #1127
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
Comments
This (an exact parser/printer) is something I would also like to see. I may work on it eventually, but it's not high on my priority list. |
It would be also nice to have the same for config files. |
I have a new parser (for .cabal files and config files). The only problem is it needs parsec which currently we cannot depend on because it causes problems for GHC. There is however a plan to get GHC to not depend on Cabal, or rather have the ghc lib not depend on Cabal, only ghc-pkg & the build system. This may allow us to depend on parsec and so we could have a fast and nice new parser. |
A silly thought: is |
|
@dcoutts: Exciting! (A patient sort of excitement.) |
I understand why we can't currently use Parsec for tthis, but would it be possible to use |
@phadej has been working on a Parsec parser which will make this easier, but if we decide to modify GPD to store this information that is a fairly major breaking change. One possibility is to store the data out of line in a data structure of its own (similar to how API annotations in GHC work.) |
It would be nice if Cabal included a parser for
.cabal
files that remembers line and column numbers for parsed entities. This could then be used by tools like packdeps to give the source location for an outdated dependency, and in turn used in text editors to annotate lines with information from packdeps when editing a .cabal file.More broadly, it would be nice to have an exact-printer for the relevant AST, to make it possible to write tools that process .cabal files programmatically without messing up their formatting.
The text was updated successfully, but these errors were encountered: