From: Evan P. <eva...@us...> - 2005-11-08 19:01:07
|
I've been using the N3Parser for a project, and I've found it really hard to use for arbitrary input. For most syntax errors, it uses die() to exit quickly. I've replaced the calls to die() such that syntax errors cause the high-level interface to return false for incorrect syntax. The parser's parseError member is set to true, and I've added an errors member to hold errors. (Theoretically the parser could recover from some errors, so this is an array.) I also changed the unit test so it checks for a false return value rather than looking for error output. Probably the better way to handle this all is with exceptions; I think that should probably wait until PHP 5 has more penetration, though. Especially since I don't use PHP 5 yet! Patch attached. I'd be happy to revise and re-submit based on feedback. ~Evan -- Evan Prodromou <eva...@us...> |