]> granicus.if.org Git - re2c/commit
Don't move the closing tag of POSIX capture group out of the enclosing iteration.
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 4 Aug 2018 09:25:01 +0000 (10:25 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sat, 4 Aug 2018 09:25:01 +0000 (10:25 +0100)
commit328788acce9811894bde451306e8b0c995256705
treee9fa5d282662db4cd0835699c9ec1910698a6977
parent4a3e72bf9e50b6f30738e5a32c6245f3ed092b63
Don't move the closing tag of POSIX capture group out of the enclosing iteration.

RE2C used to perform the following optimization: when a POSIX capture is
under iteration, we only need to get tag values of the last iteration
(according to the POSIX standard). Therefore we can move the closing tag
out of loop.

This commit removes this optimization (as part of the effort to switch
from Kuklewicz POSIX disambiguation algorthm to Okui algorithm).

In other words, for RE (x)* re2c used to generate this "optimized" IRE:
    1 (3 x)* 4 2
and now it generates the "canonical" IRE:
    1 (3 x 4)* 2

Updated tests for '--posix-captures' that have been affected by the change.
87 files changed:
re2c/src/re/ast_to_re.cc
re2c/test/posix_captures/basic/01.i--flex-syntax.c
re2c/test/posix_captures/basic/02.i--flex-syntax.c
re2c/test/posix_captures/basic/37.i--flex-syntax.c
re2c/test/posix_captures/basic/40.i--flex-syntax.c
re2c/test/posix_captures/basic/43.i--flex-syntax.c
re2c/test/posix_captures/categorize/06.i--flex-syntax.c
re2c/test/posix_captures/categorize/09.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/08.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/13.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/15.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/20.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/36.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/43.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/44.i--flex-syntax.c
re2c/test/posix_captures/glennfowler/45.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/02.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/04.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/06.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/16.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/17.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/18.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/19.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/20.i--flex-syntax.c
re2c/test/posix_captures/nullsubexpr/21.i--flex-syntax.c
re2c/test/posix_captures/osxbsdcritical/03.i--flex-syntax.c
re2c/test/posix_captures/osxbsdcritical/06.i--flex-syntax.c
re2c/test/posix_captures/other/11.i--flex-syntax.c
re2c/test/posix_captures/other/13.i--flex-syntax.c
re2c/test/posix_captures/other/15.i--flex-syntax.c
re2c/test/posix_captures/other/16.i--flex-syntax.c
re2c/test/posix_captures/other/18.i--flex-syntax.c
re2c/test/posix_captures/other/19.i--flex-syntax.c
re2c/test/posix_captures/other/21.i--flex-syntax.c
re2c/test/posix_captures/other/22.i--flex-syntax.c
re2c/test/posix_captures/other/24.i--flex-syntax.c
re2c/test/posix_captures/other/25.i--flex-syntax.c
re2c/test/posix_captures/other/26.i--flex-syntax.c
re2c/test/posix_captures/repetition/05.i--flex-syntax.c
re2c/test/posix_captures/repetition/06.i--flex-syntax.c
re2c/test/posix_captures/repetition/12.i--flex-syntax.c
re2c/test/posix_captures/repetition/13.i--flex-syntax.c
re2c/test/posix_captures/repetition/19.i--flex-syntax.c
re2c/test/posix_captures/repetition/20.i--flex-syntax.c
re2c/test/posix_captures/repetition/26.i--flex-syntax.c
re2c/test/posix_captures/repetition/27.i--flex-syntax.c
re2c/test/posix_captures/repetition/33.i--flex-syntax.c
re2c/test/posix_captures/repetition/34.i--flex-syntax.c
re2c/test/posix_captures/repetition/40.i--flex-syntax.c
re2c/test/posix_captures/repetition/41.i--flex-syntax.c
re2c/test/posix_captures/repetition/47.i--flex-syntax.c
re2c/test/posix_captures/repetition/48.i--flex-syntax.c
re2c/test/posix_captures/repetition/51.i--flex-syntax.c
re2c/test/posix_captures/repetition/52.i--flex-syntax.c
re2c/test/posix_captures/repetition/53.i--flex-syntax.c
re2c/test/posix_captures/repetition/54.i--flex-syntax.c
re2c/test/posix_captures/repetition/55.i--flex-syntax.c
re2c/test/posix_captures/repetition/56.i--flex-syntax.c
re2c/test/posix_captures/repetition/57.i--flex-syntax.c
re2c/test/posix_captures/repetition/58.i--flex-syntax.c
re2c/test/posix_captures/repetition/60.i--flex-syntax.c
re2c/test/posix_captures/repetition/61.i--flex-syntax.c
re2c/test/posix_captures/repetition/62.i--flex-syntax.c
re2c/test/posix_captures/repetition/63.i--flex-syntax.c
re2c/test/posix_captures/repetition/64.i--flex-syntax.c
re2c/test/posix_captures/repetition/65.i--flex-syntax.c
re2c/test/posix_captures/repetition/66.i--flex-syntax.c
re2c/test/posix_captures/repetition/67.i--flex-syntax.c
re2c/test/posix_captures/repetition/69.i--flex-syntax.c
re2c/test/posix_captures/repetition/70.i--flex-syntax.c
re2c/test/posix_captures/repetition/71.i--flex-syntax.c
re2c/test/posix_captures/repetition/72.i--flex-syntax.c
re2c/test/posix_captures/repetition/74.i--flex-syntax.c
re2c/test/posix_captures/repetition/75.i--flex-syntax.c
re2c/test/posix_captures/repetition/76.i--flex-syntax.c
re2c/test/posix_captures/repetition/77.i--flex-syntax.c
re2c/test/posix_captures/repetition/79.i--flex-syntax.c
re2c/test/posix_captures/repetition/81.i--flex-syntax.c
re2c/test/posix_captures/repetition/82.i--flex-syntax.c
re2c/test/posix_captures/repetition/83.i--flex-syntax.c
re2c/test/posix_captures/repetition/84.i--flex-syntax.c
re2c/test/posix_captures/repetition/86.i--flex-syntax.c
re2c/test/posix_captures/repetition/87.i--flex-syntax.c
re2c/test/posix_captures/repetition/88.i--flex-syntax.c
re2c/test/posix_captures/repetition/89.i--flex-syntax.c
re2c/test/posix_captures/repetition/91.i--flex-syntax.c
re2c/test/posix_captures/skeleton_01.i--posix-captures.c