Monday, April 14, 2008

Edge case problem

Tonight I found a flaw in chunk termination parsing. This doesn't do the right thing:

[[foo bar;baz quux]]
The problem is that the method which detects the ends of chunks which are currently being processed declares this chunk to be completely parsed when the terminator is seen. It isn't, though, as "quux" is trigger content, and is not handled by the trigger handler -- it is taken care of by the text handler.

The proper thing to do is to declare the chunk incomplete, return the node as it stands, and for the Grammarian's processing loop to take back over (and then hand off to the text handler).

This issue survived so long because... well, I'm not sure how I managed to not have a test case like this in my suite of almost 650 tests, but I didn't, so that was problem number one. Problem number two is that integration testing of the handlers has not yet begun, though it is perilously close.

The correct implementation of the solution to this problem is not yet known.

Mood: :-/

No comments: