]> granicus.if.org Git - re2c/commitdiff
- Fix bug 1054496
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Thu, 31 Mar 2005 16:24:09 +0000 (16:24 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Thu, 31 Mar 2005 16:24:09 +0000 (16:24 +0000)
code.cc

diff --git a/code.cc b/code.cc
index 26982b1437fe3b851cc387f29b64963d8e1a7f1f..8375b9916e64cb89cf1c401679dc4fcdc57867e8 100644 (file)
--- a/code.cc
+++ b/code.cc
@@ -250,15 +250,15 @@ void BitMap::stats()
        first = NULL;
 }
 
-void genGoTo(std::ostream &o, State *from, State *to, bool & readCh)
+void genGoTo(std::ostream &o, State *from, State *to, bool & readCh, const char *indent = "\t")
 {
        if (readCh && from->label + 1 != to->label)
        {
-               o << "\tyych = *YYCURSOR;\n";
+               o << indent << "yych = *YYCURSOR;\n";
                readCh = false;
        }
 
-       o << "\tgoto yy" << to->label << ";\n";
+       o << indent << "goto yy" << to->label << ";\n";
        ++oline;
        vUsedLabels.append(to->label);
 }
@@ -701,8 +701,11 @@ void Go::genGoto(std::ostream &o, State *from, State *next, bool &readCh)
                                                o << "yych";
                                        }
 
-                                       o << "] & " << (uint) b->m << ")";
-                                       genGoTo(o, from, to, readCh);
+                                       o << "] & " << (uint) b->m << ") {\n";
+                                       oline++;
+                                       genGoTo(o, from, to, readCh, "\t\t");
+                                       o << "\t}\n";
+                                       oline++;
                                        go.genBase(o, from, next, readCh);
                                        delete [] go.span;
                                        return ;