Re: GHC API (parsing)
how can I convince the Language.Haskell.Parser to accept GHC Haskell (i.e., -fglasgow-exts, e.g. for existential types) You use my haskell-src-exts package instead. :-) http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src-exts-0.3.3 Cheers, /Niklas ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
GHC API (parsing)
Dear all, how can I convince the Language.Haskell.Parser to accept GHC Haskell (i.e., -fglasgow-exts, e.g. for existential types) or: how can I convince the GHC API loader to parse a module from a string (not from a file)? Any hints appreciated, Johannes. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC API (parsing)
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src-exts-0.3.3 interesting, I'll look into that. * it's not exactly a drop-in replacement for Language.Haskell.* ? (HsNewTypeDecl is different?) * for the others, number of constructor arguments does not match, e.g. `HsConDecl' should have 2 arguments, but has been given 3 * how is your parser tied to ghc? I.e. what happens if the next ghc release introduces new syntax? general question * is there any parser that keeps comments (i.e. makes AST nodes from them)? what parser does Haddock use? Best regards, J.W. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC API (parsing)
* it's not exactly a drop-in replacement for Language.Haskell.* ? (HsNewTypeDecl is different?) * for the others, number of constructor arguments does not match, e.g. `HsConDecl' should have 2 arguments, but has been given 3 Indeed it is like you say, these are pragmatic choices. The extensions introduce new requirements, and the choice was between modelling only the general case, or separating the H98 case and the extension as two different constructors. I chose the former, since I believe anyone using this library would want to use the extensions anyway, and choosing the latter would have meant a lot of extra boilerplate code (for the user, not me). * how is your parser tied to ghc? I.e. what happens if the next ghc release introduces new syntax? It is not at all tied to ghc, other than that I try to keep up with the major extensions that ghc provides. There are some things in ghc that my library does not model, e.g. arrows syntax (patches welcome!). But if there's anything specific that you need that isn't already in there, drop me a feature request and I'll try to fix it for you. Cheers, /Niklas ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC API (parsing)
general question * is there any parser that keeps comments (i.e. makes AST nodes from them)? what parser does Haddock use? you might want to add your voice and cc to Ticket #1886 ;-) GHC API should preserve and provide access to comments http://hackage.haskell.org/trac/ghc/ticket/1886 claus ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC API (parsing)
GHC API should preserve and provide access to comments http://hackage.haskell.org/trac/ghc/ticket/1886 What does this lead to? Introspection? So you can get haddock comments from ghci? This would be interesting Marc Weber ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: GHC API (parsing)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Introspection? So you can get haddock comments from ghci? see also http://hackage.haskell.org/trac/ghc/ticket/2168 best regards, j.w. -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIA8PH3ZnXZuOVyMIRAjnyAJ4qtDaBWUbBIuWGfZnP4yboC08FNQCfYvuX PZmW/t7u1Qnhjxzx4Lz+pys= =XPmx -END PGP SIGNATURE- ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users