[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: parser : which library ?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 31 May 2011 08:58:57 -0300
> Another approach is to use a match-time capture on a pattern that only
> gets triggered when there's a parsing error and then use the character
> index that's passed in to calculate the line number.
LPeg itself uses a similar technique (in module 're'), except that
it extracts a substring with the vicinity of the error point instead
of the line number.