]> granicus.if.org Git - re2c/commit
Fixed tag substitution.
authorUlya Trofimovich <skvadrik@gmail.com>
Fri, 13 May 2016 12:51:44 +0000 (13:51 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Fri, 13 May 2016 12:51:44 +0000 (13:51 +0100)
commite705710cb038d5734e66546f7b304bed19b40a1f
treeeeaf2a0b947de69ab7f13b78b0099cfd0fb570ce
parent259c5316c520edbd1ef1b8808ffda9212b2cf0f6
Fixed tag substitution.

If one tag name, say 'p', is a prefix of another tag name, say 'p1',
and we try to substitute all occurences of '@p' in the given string,
we might occasionally substitute '@p1'.

I made a small re2c lexer that recognizes tag-like lexemes and
tries to match them agains rule's tags. If a tag's name matches the
recognized substring, than it is the perfect match (name cannot be
a prefix of a longer name because lexer recognizes the longest match).
re2c/Makefile.am
re2c/bootstrap/src/codegen/subst_tags.cc [new file with mode: 0644]
re2c/src/codegen/emit.h
re2c/src/codegen/emit_action.cc
re2c/src/codegen/subst_tags.re [new file with mode: 0644]
re2c/test/tags/subst.i--tags.c [new file with mode: 0644]
re2c/test/tags/subst.i--tags.re [new file with mode: 0644]