[Haskell-cafe] Wanted: composoable parsers from haskell-src-exts
niklas.broberg at gmail.com
Tue Mar 15 09:15:52 CET 2011
The answer is:
A) You can't, the way haskell-src-exts is built. You need to specify the
%partial directives in the happy grammar, so without editing
haskell-src-exts there's no way you could tack on partiality to the existing
B) It's a great feature request (to the point where I wonder why I haven't
thought of it before), that should be quite easy to implement. I already
export a partial parser for top-of-file pragmas, there's no reason why I
couldn't export partial parsers for all the other entry points as well. I
hope I can implement it shortly, but if you want it really fast and certain
- patches are most welcome!
On Mon, Mar 14, 2011 at 6:55 PM, J. Waldmann
<waldmann at imn.htwk-leipzig.de>wrote:
> I want to use parsers from haskell-src-exts as sub-parsers,
> which does not seem to work since they insist on consuming the input
> I would need them to parse a maximal prefix,
> and return the (unconsumed) rest of input as well
> I figure that happy has the %partial directive for that, but the
> does not really tell me how to obtain the rest of the input.
> Any hints (or code samples) appreciated. Thanks - J.W.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe