- Use descriptive name scheme for variable overwriting, too
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Fri, 23 Feb 2007 21:28:17 +0000 (21:28 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Fri, 23 Feb 2007 21:28:17 +0000 (21:28 +0000)
re2c/code.cc
re2c/test/config8.re

index 9381e66eb4cdfc9e4e779a978798273386690431..17851bb79ed90c5abbf9968fd1c90d2f9cd02aff 100644 (file)
@@ -1697,7 +1697,7 @@ void Scanner::config(const Str& cfg, int num)
        }
 }
 
-static std::set<std::string> mapCodeKeys;
+static std::set<std::string> mapVariableKeys;
 static std::set<std::string> mapDefineKeys;
 static std::set<std::string> mapLabelKeys;
 
@@ -1705,10 +1705,10 @@ void Scanner::config(const Str& cfg, const Str& val)
 {
        if (mapDefineKeys.empty())
        {
-               mapCodeKeys.insert("code:yyaccept");
-               mapCodeKeys.insert("code:yybm");
-               mapCodeKeys.insert("code:yych");
-               mapCodeKeys.insert("code:yytarget");
+               mapVariableKeys.insert("variable:yyaccept");
+               mapVariableKeys.insert("variable:yybm");
+               mapVariableKeys.insert("variable:yych");
+               mapVariableKeys.insert("variable:yytarget");
                mapDefineKeys.insert("define:YYCTXMARKER");
                mapDefineKeys.insert("define:YYCTYPE");
                mapDefineKeys.insert("define:YYCURSOR");
@@ -1748,10 +1748,10 @@ void Scanner::config(const Str& cfg, const Str& val)
        {
                labelPrefix = strVal;
        }
-       else if (mapCodeKeys.find(cfg.to_string()) != mapCodeKeys.end())
+       else if (mapVariableKeys.find(cfg.to_string()) != mapVariableKeys.end())
     {
        if (bFirstPass && !mapCodeName.insert(
-                       std::make_pair(cfg.to_string().substr(sizeof("code:") - 1), strVal)
+                       std::make_pair(cfg.to_string().substr(sizeof("variable:") - 1), strVal)
                        ).second)
        {
                        fatal("variable already being used and cannot be changed");
index 7576fb9c3f0ba8ed4956037c25880fe3666fb5bf..9c0aa09c6a844570a4415d8009f7d91bf378e749 100755 (executable)
@@ -48,7 +48,7 @@ re2c:define:YYMARKER  = s.ptr;
 re2c:define:YYCTXMARKER        = s.ctx;
 re2c:define:YYFILL      = fill;
 
-re2c:code:yych          = curr;
+re2c:variable:yych      = curr;
 re2c:labelprefix        = xx;
 
 ("a"|"b")/[1]    { return KEYWORD; }