I am finding that expressions of the form
X / Y
result in YYCURSOR pointing after Y instead of after X, i.e., the trailing context is consumed - if Y can also be matched by X.
In the attached example there are two expressions to be matched. In the first, any number of "a" or "b" characters followed by a final "b":
[ab]* / "b"
In the second, any number of "c" followed by a final "d":
[c]* / "d"
I find that, in the first example, matches result in YYCURSOR pointing past the final "b", which is the trailing context. In the second example, matches result in YYCURSOR pointing, correctly, at the final "d".
re2c_testcase.zip
I am finding that expressions of the form
X / Yresult in
YYCURSORpointing afterYinstead of afterX, i.e., the trailing context is consumed - ifYcan also be matched byX.In the attached example there are two expressions to be matched. In the first, any number of "a" or "b" characters followed by a final "b":
[ab]* / "b"In the second, any number of "c" followed by a final "d":
[c]* / "d"I find that, in the first example, matches result in YYCURSOR pointing past the final "b", which is the trailing context. In the second example, matches result in YYCURSOR pointing, correctly, at the final "d".
re2c_testcase.zip