When displaying printables in graphviz output, print 32 as SP.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sun, 11 Feb 2007 06:12:22 +0000 (06:12 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sun, 11 Feb 2007 06:12:22 +0000 (06:12 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@96 052ea7fc-9027-0410-9066-f65837a77df0

rlcodegen/gvdotgen.cpp

index 6aa7e76..3be8626 100644 (file)
@@ -31,37 +31,38 @@ std::ostream &GraphvizDotGen::KEY( Key key )
        if ( printPrintables && key.isPrintable() ) {
                // Output values as characters, ensuring we escape the quote (") character
                char cVal = (char) key.getVal();
-               out << "'";
                switch ( cVal ) {
                        case '"': case '\\':
-                               out << "\\" << cVal;
+                               out << "'\\" << cVal << "'";
                                break;
                        case '\a':
-                               out << "\\\\a";
+                               out << "'\\\\a'";
                                break;
                        case '\b':
-                               out << "\\\\b";
+                               out << "'\\\\b'";
                                break;
                        case '\t':
-                               out << "\\\\t";
+                               out << "'\\\\t'";
                                break;
                        case '\n':
-                               out << "\\\\n";
+                               out << "'\\\\n'";
                                break;
                        case '\v':
-                               out << "\\\\v";
+                               out << "'\\\\v'";
                                break;
                        case '\f':
-                               out << "\\\\f";
+                               out << "'\\\\f'";
                                break;
                        case '\r':
-                               out << "\\\\r";
+                               out << "'\\\\r'";
+                               break;
+                       case ' ':
+                               out << "SP";
                                break;
                        default:        
-                               out << cVal;
+                               out << "'" << cVal << "'";
                                break;
                }
-               out << "'";
        }
        else {
                if ( keyOps->isSigned )