]> granicus.if.org Git - re2c/commit
Added cmd option "--empty-class <match-empty|match-none|error>".
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 16 Jun 2015 13:17:17 +0000 (14:17 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 16 Jun 2015 13:17:17 +0000 (14:17 +0100)
commit5cdb7a1af45ab02bf54e14ab5e72882cb5bf9f6d
tree28ef226d6144a1eb7b775319946cf31c0f6c2061
parent7157354c453d3f4ba538bf73ac76d2a2d2311dee
Added cmd option "--empty-class <match-empty|match-none|error>".

This option controls re2c actions when it encounters empty character
class (e.g. [], [^\0x00-\xFF] or [\0x00-\xFF]\[\0x00-\xFF]):
    match-empty (default) - match on empty input
    match-none - fail to match on any input
    error - compilation error

This is a final fix for bug #61 "empty character class [] matches empty string".
53 files changed:
re2c/src/globals.h
re2c/src/ir/regexp/empty_class_policy.h [new file with mode: 0644]
re2c/src/ir/regexp/regexp.cc
re2c/src/main.cc
re2c/test/bug61.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61.i--empty-class(error).re [moved from re2c/test/bug61a.i.re with 84% similarity]
re2c/test/bug61.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61.i.c
re2c/test/bug61.i.re
re2c/test/bug61_difference_full.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_difference_full.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_difference_full.i.c [new file with mode: 0644]
re2c/test/bug61_difference_full.i.re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_difference_negative.i.c [new file with mode: 0644]
re2c/test/bug61_difference_negative.i.re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_difference_positive.i.c [new file with mode: 0644]
re2c/test/bug61_difference_positive.i.re [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_negative.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_negative.i.c [new file with mode: 0644]
re2c/test/bug61_negative.i.re [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(error).c [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(error).re [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-empty).c [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-empty).re [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-none).c [new file with mode: 0644]
re2c/test/bug61_positive.i--empty-class(match-none).re [new file with mode: 0644]
re2c/test/bug61_positive.i.c [new file with mode: 0644]
re2c/test/bug61_positive.i.re [new file with mode: 0644]
re2c/test/bug61a.i.c [deleted file]