]> granicus.if.org Git - re2c/commit
Moved conditions and contexts from global scope to block scope.
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 5 Apr 2016 22:01:33 +0000 (23:01 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 5 Apr 2016 22:01:33 +0000 (23:01 +0100)
commit8273692408156dfef87ded5c334ed3170d40132e
tree72cafddf25d4e0311f1a146453d0983c4294044e
parent6cc8a34108b22bf1ecd2753511212c0cbc5d70d1
Moved conditions and contexts from global scope to block scope.

Directives like '/*!re2c:types*/' and '/*!re2c:contexts*/' have
global scope, they are not binded to any particular block and therefore
accumulate items (conditions/contexts/etc.) from the whole program.

There's currently no way to bind these directives to a particular
block (re2c will probably add scoping rules in future).

However, things like default context declaration or condition dispatch
have block scope (it's only natural that they are binded to the block
that generates them).

Unrelated change: context marker should be set for each condition,
re2c must generate it after condition label: this way code that skips
condition dispatch and jums directly to condition label will still
have context marker adjusted properly.
14 files changed:
re2c/bootstrap/src/parse/lex.cc
re2c/bootstrap/src/parse/lex_conf.cc
re2c/bootstrap/src/parse/parser.cc
re2c/src/codegen/emit_dfa.cc
re2c/src/codegen/output.cc
re2c/src/codegen/output.h
re2c/src/ir/compile.cc
re2c/src/parse/lex_conf.re
re2c/src/parse/parser.ypp
re2c/test/contexts/cond_star0.ci--input(custom).c
re2c/test/contexts/cond_star0.ci.c
re2c/test/contexts/cond_star1.ci--input(custom).c
re2c/test/contexts/cond_star1.ci.c
re2c/test/contexts/cond_star2.ci.c