haskell-suite / haskell-src-exts

Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer
Other
193 stars 94 forks source link

Add support for parsing TemplateHaskell typed splices. #410

Closed rickowens closed 4 years ago

rickowens commented 6 years ago

This is really an attempt to fix hlint. See https://github.com/haskell-suite/haskell-src-exts/issues/383

I started out with splices $$(..) instead of quotes. If this works out, I'll add typed quotes.

It should be noted that I do not have a great or even decent understanding of this package. This is an attempt to "get it to work", where "get it to work" means that hlint, compiled against this library, will not fail to parse typed template haskell splices.

rickowens commented 6 years ago

cc @MHova

rickowens commented 6 years ago

So the travis build failed, but for a reason I don't think has anything to do with the change:

Reading package lists...
W: GPG error: http://ppa.launchpad.net/hvr/ghc/ubuntu trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FF3AEACEF6F88286
W: The repository 'http://ppa.launchpad.net/hvr/ghc/ubuntu trusty InRelease' is not signed.
W: There is no public key available for the following key IDs:
FF3AEACEF6F88286  
W: http://ppa.launchpad.net/couchdb/stable/ubuntu/dists/trusty/Release.gpg: Signature by key 15866BAFD9BCC4F3C1E0DFC7D69548E1C17EAB57 uses weak digest algorithm (SHA1)
The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages install cabal-install-2.0 ghc-8.2.2 happy-1.19.5" failed and exited with 100 during .
Your build has been stopped.

I'm not sure how to address this.

mpickering commented 6 years ago

A good start but it should not parse to SpliceDecl, it should be possible to differentiate the different syntactic forms in the syntax tree so you have to either add a new field to SpliceDecl or a new constructor.

rickowens commented 6 years ago

Ok. Thanks for the feedback. I will make this fix as soon as I have a little bit of time.

dzhus commented 5 years ago

I've come across the same issue – have a look at #432 maybe

DanBurton commented 4 years ago

This was superceded by #432