1) My most desired feature would be a syntax tree that does not pluck
pluck comments out and make me treat them separately. It looks much
easier to me to have a fully descriptive tree and (filter . concatMap) /
traverse them out in some way than getting a list of comments and having
to insert them back in the right places myself.
Is that possible?
2) Have you considered downloading the all-of-Hackage tarball and
running haskell-src-exts over it to get a benchmark of how much HSE can
already parse of the Haskell code out there?
Good stuff!
Is there any way, or plans for a way, to parse a file based on its LANGUAGE pragmas? Last I checked e.g. HSP simply enabled all extensions when parsing, which can cause code to be parsed incorrectly in some cases.
--
You received this message because you are subscribed to the Google Groups "Haskell Server Pages" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-server-p...@googlegroups.com.
To post to this group, send email to haskell-se...@googlegroups.com.
Visit this group at http://groups.google.com/group/haskell-server-pages.
For more options, visit https://groups.google.com/groups/opt_out.
HSE parses based on pragmas by default. This can be configured through the ParseMode [1].
But your question regards HSP, Haskell Server Pages, which indeed just enables most extensions by default. Right now there's no way to configure that, but it shouldn't be hard for a skilled programmer to fix. Patches most welcome. :-)
Cheers, Niklas
> The first primary reason is
> technical: haskell-src-exts
> 1.14 revamps the Extension
> datatype, among other things
> to allow turning extensions on
> and off (similar to what Cabal
> allows). We also introduce the
> concept of a Language,
> separate from a set of
> extensions. This is the only
> backwards-incompatible
> change in this release.
Heads-up: as was pointed out to me, the above is not true. The constructors of the Tuple type have also changed, which means greater risks for breakage. Proceed with this in mind.
Cheers, Niklas
Wouldn't it be better to only enable Haskell2010
and XmlSyntax
and then rely on LANGUAGE
pragmas? I guess optimally we want to add support for -X
options to hsx2hs
but in the mean time…
BTW I think hsx2hs
is in fact affected by these backwards-incompatible changes, and lacks an upper bound on its HSE dependency!
Is hub.darcs.net the official location of the hsx2hs repository these days?
On 20 Aug 2013 16:59, "Dag Odenhall" <dag.od...@gmail.com> wrote:
>
> Wouldn't it be better to only
> enable Haskell2010 and
> XmlSyntax and then rely on
> LANGUAGE pragmas? I guess
> optimally we want to add
> support for -X options to
> hsx2hs but in the mean time…
Sounds reasonable to me. Jeremy, any objections?
> BTW I think hsx2hs is in fact
> affected by these backwards-
> incompatible changes, and
> lacks an upper bound on its
> HSE dependency!
Ouch. Will fix then, pending discussion on the above.
> Is hub.darcs.net the official
> location of the hsx2hs
> repository these days?
Yup.
Cheers, Niklas
On 20 Aug 2013 16:59, "Dag Odenhall" <dag.od...@gmail.com> wrote:
>
> Wouldn't it be better to only
> enable Haskell2010 and
> XmlSyntax and then rely on
> LANGUAGE pragmas? I guess
> optimally we want to add
> support for -X options to
> hsx2hs but in the mean time…Sounds reasonable to me. Jeremy, any objections?
Ah, that's a good point. A hack could be to use location :: Q Loc
and scan the containing source file for LANGUAGE
pragmas. If HSE is used for that part it would mean the QQ doesn‘t let you work around issues when HSE fails to parse the full source file, though. Also, it would still need to fall back to some default if the file can’t be read (such as when used from ghci
). It's a rather gross hack all together, but no worse than what QuickCheck does in its All
module.