]> granicus.if.org Git - re2c/commitdiff
Continued separating .dot case from other cases in codegen.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 4 Mar 2015 15:43:43 +0000 (15:43 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 4 Mar 2015 15:43:43 +0000 (15:43 +0000)
re2c/code.cc

index 99c8e7c8fc55c686962fdd3277051a485606435f..612a5581760e9d987db53850a5dc57a070c94e86 100644 (file)
@@ -1019,22 +1019,19 @@ void Go::genSwitch(OutputFile & o, uint ind, const State *from, const State *nex
                        }
                }
 
-               if (!DFlag)
+               if (dFlag)
                {
-                       if (dFlag)
-                       {
-                               o << indent(ind) << mapCodeName["YYDEBUG"] << "(-1, " << mapCodeName["yych"] << ");\n";
-                       }
+                       o << indent(ind) << mapCodeName["YYDEBUG"] << "(-1, " << mapCodeName["yych"] << ");\n";
+               }
 
-                       if (readCh)
-                       {
-                               o << indent(ind) << "switch ((" << input_api.expr_peek_save () << ")) {\n";
-                               readCh = false;
-                       }
-                       else
-                       {
-                               o << indent(ind) << "switch (" << mapCodeName["yych"] << ") {\n";
-                       }
+               if (readCh)
+               {
+                       o << indent(ind) << "switch ((" << input_api.expr_peek_save () << ")) {\n";
+                       readCh = false;
+               }
+               else
+               {
+                       o << indent(ind) << "switch (" << mapCodeName["yych"] << ") {\n";
                }
 
                while (t != &sP[0])
@@ -1066,7 +1063,7 @@ void Go::genSwitch(OutputFile & o, uint ind, const State *from, const State *nex
                                }
                        }
 
-                       if (used && !DFlag)
+                       if (used)
                        {
                                genGoTo(o, newLine ? ind+1 : 1, from, to, readCh);
                                newLine = true;
@@ -1074,23 +1071,9 @@ void Go::genSwitch(OutputFile & o, uint ind, const State *from, const State *nex
                        t = r;
                }
 
-               if (DFlag)
-               {
-                       if (!newLine)
-                       {
-                               o << "\n";
-                               newLine = true;
-                       }
-
-                       o << from->label << " -> " << def->label;
-                       o << " [label=default]\n" ;
-               }
-               else
-               {
-                       o << indent(ind) << "default:";
-                       genGoTo(o, 1, from, def, readCh);
-                       o << indent(ind) << "}\n";
-               }
+               o << indent(ind) << "default:";
+               genGoTo(o, 1, from, def, readCh);
+               o << indent(ind) << "}\n";
 
                delete [] sP;
        }