]> granicus.if.org Git - re2c/commit
In greedy regexps first alternative must correspond to consuming path.
authorUlya Trofimovich <skvadrik@gmail.com>
Mon, 13 Feb 2017 15:01:12 +0000 (15:01 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Mon, 13 Feb 2017 15:01:12 +0000 (15:01 +0000)
commit03c65121da3f8bcb412576568cfff6cbca039470
treee5edeb9d845edfd86d6a493d36216de196b9b7ca
parent752e1e41b77d73e4df761d2ff80c66725e595454
In greedy regexps first alternative must correspond to consuming path.

By convention first alternative has higher priority.
So, for example, the following must be true:
    r*     = rr* | <empty>
    r{n,m} = r{n} (r{m - n} | r{m - n - 1} | ... | r{1} | <empty>)
    r{n,}  = r{n} (rr* | <empty>)

For now we don't care about priorities: this is a preparatory step
before transition to greedy leftmost semantics for tags.
re2c/bootstrap/src/parse/lex.cc
re2c/bootstrap/src/parse/parser.cc
re2c/src/ir/nfa/regexps2nfa.cc
re2c/src/ir/regexp/regexp.cc
re2c/src/parse/parser.ypp