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

index 8d031644b7ef41eceb65e9fbbb292f4641d98f23..65d0d5c5eab5c6ba7c338fa367d988540e15a759 100644 (file)
@@ -821,9 +821,8 @@ static void printDotCharInterval(OutputFile & o, uint lastPrintableChar, uint ch
        o << "]";
 }
 
-static bool genCasesD(OutputFile & o, uint lb, Span *s, bool &newLine, const State *from, const State *to)
+static void genCasesD(OutputFile & o, uint lb, Span *s, bool &newLine, const State *from, const State *to)
 {
-       bool used = false;
        uint lastPrintableChar = 0;
 
        if (!newLine)
@@ -852,7 +851,6 @@ static bool genCasesD(OutputFile & o, uint lb, Span *s, bool &newLine, const Sta
                        printDotCharInterval(o, lastPrintableChar, lb, from, to, true);
                        lastPrintableChar = 0;
                        newLine = false;
-                       used = true;
 
                        if (++lb == s->ub)
                        {
@@ -871,8 +869,6 @@ static bool genCasesD(OutputFile & o, uint lb, Span *s, bool &newLine, const Sta
                o << "\n";
                newLine = true;
        }
-
-       return used;
 }
 
 static bool genCases(OutputFile & o, uint ind, uint lb, Span *s, bool &newLine, uint mask)
@@ -945,26 +941,24 @@ void Go::genSwitchD (OutputFile & o, const State *from) const
 
                while (t != &sP[0])
                {
-                       bool used = false;
-
                        r = s = &sP[0];
 
                        const State *to = (*s)->to;
 
                        if (*s == &span[0])
                        {
-                               used |= genCasesD(o, 0, *s, newLine, from, to);
+                               genCasesD(o, 0, *s, newLine, from, to);
                        }
                        else
                        {
-                               used |= genCasesD(o, (*s)[ -1].ub, *s, newLine, from, to);
+                               genCasesD(o, (*s)[ -1].ub, *s, newLine, from, to);
                        }
 
                        while (++s < t)
                        {
                                if ((*s)->to == to)
                                {
-                                       used |= genCasesD(o, (*s)[ -1].ub, *s, newLine, from, to);
+                                       genCasesD(o, (*s)[ -1].ub, *s, newLine, from, to);
                                }
                                else
                                {