Hi all, this series is an alternative way to fix the anchor bug that I reported a few weeks ago. Instead of dumbing down the position_set data structure, this series actually fixes the root cause. The cause is that the (8-bit) constraint field is not able to represent all pairs of characters, because there are nine possibilities for (word, nonword, newline) x (word, nonword, newline).
I've done the fix on top of my alternative representation of context, which reuses the values in d->success instead of using separate fields for newline and letter. This is for two reasons. First, I'm more comfortable with this representation because I designed it. Second, the 3-bit representation for word/nonword/newline makes a lot more sense given how I am representing constraints as a 3*3=9-bit string. Please review. Paolo Bonzini (8): dfa: remove useless check dfa: introduce contexts for the values in d->success dfa: change newline/letter to a single context value dfa: refactor common context computations dfa: change meaning of a state context dfa: do not use MATCHES_*_CONTEXT directly dfa: fix constraint encoding dfa: merge calls to SUCCEEDS_IN_CONTEXT NEWS | 5 + src/dfa.c | 376 +++++++++++++++++++++++++++----------------------- tests/spencer1.tests | 12 ++ 3 files changed, 220 insertions(+), 173 deletions(-) -- 1.7.7.1
