]> granicus.if.org Git - re2c/commit
Fixed bug #116: "empty string with non-empty trailing context consumes code units".
authorUlya Trofimovich <skvadrik@gmail.com>
Sun, 4 Oct 2015 18:25:00 +0000 (19:25 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sun, 4 Oct 2015 18:25:00 +0000 (19:25 +0100)
commit14911dbae5c1ba0d920d179a0e02a8950849d811
tree45d8a13a93e005194ed0d9a9e2cc7e116774b0c5
parent7f7121334b919b1f9138a17165e3e3d54b02d0b0
Fixed bug #116: "empty string with non-empty trailing context consumes code units".

Prior to this commit backup of trailing context position was done
before advancing input position and re2c either had to emit
    YYCTXMARKER = YYCURSOR + 1;
(with default input API), or
    YYRESTORECTX ();
    YYSKIP ();
(with custom input API).

The problem is that sometimes initial state doesn't sdvance input position
at all. Now re2c emits context backup after advancing input position and it
no longer needs '+1' or 'YYSKIP' hacks. It always backups the correct position.
21 files changed:
re2c/src/codegen/emit_action.cc
re2c/src/codegen/emit_dfa.cc
re2c/src/codegen/input_api.cc
re2c/test/bug116.c [new file with mode: 0644]
re2c/test/bug116.re [new file with mode: 0644]
re2c/test/config10.c
re2c/test/config8.c
re2c/test/config9.b.c
re2c/test/ctx.b.c
re2c/test/ctx.c
re2c/test/ctx.s.c
re2c/test/input_custom_default.--input(custom).c
re2c/test/input_custom_fgetc.--input(custom).c
re2c/test/input_custom_istringstream.--input(custom).c
re2c/test/modula.c
re2c/test/rexx.--empty-class(match-empty).c
re2c/test/rexx.--empty-class(match-none).c
re2c/test/rexx.c
re2c/test/scanner_re2c.bi.c
re2c/test/scanner_re2c_default.bi.c
re2c/test/strip_003.b.c