[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lpeg.match
- From: Gavin Wraith <gavin@...>
- Date: Wed, 28 Feb 2007 22:13:11 GMT
Please correct me if I am wrong, but my inspection of lpeg.c
(the documentation is not very specific) persuades me that if pattern:match(text) fails then it returns nil. Would it not be
more useful if an error object could be returned as well?
In writing a grammar one wants to be able to create context-bearing
error messages sometimes:
grammar = lpeg.P { ...
[NonTerminal] = Pattern_if_OK + Fail(grammar.name,Name[NonTerminal]);
.... }
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/