17 May 00:45
Re: Re: Proving my point
From: Philippa Cowderoy <flippa <at> flippac.org>
Subject: Re: Re: Proving my point
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2008-05-16 22:45:51 GMT
Subject: Re: Re: Proving my point
Newsgroups: gmane.comp.lang.haskell.cafe
Date: 2008-05-16 22:45:51 GMT
On Sat, 17 May 2008, Achim Schneider wrote: > There's at least one token before any recursion, so I guess not. After > all, it terminates. It's my state that does not succeed in directing > the parser not to mess up, so I'm reimplementing the thing as a > two-pass but stateless parser now. In most cases, you're better off stateless unless you've got a really good reason for it. Or at least, not using the state for anything that affects the parse itself. > Definitely the easier and clearer > thing to do: I can have an end of line token that carries the number of > trailing spaces, so I got perfect indent information without any pain > involved, at all, and don't have to make parsers fail based on state. > Definitely! Are you doing some form of layout? It's certainly not worth doing in one pass IMO, I ended up with a three pass design much like that in the Haskell 98 report. Well, that's an understatement - I took the algorithm from it! -- -- flippa <at> flippac.org There is no magic bullet. There are, however, plenty of bullets that magically home in on feet when not used in exactly the right circumstances.
RSS Feed