]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/textwriter.cpp
Drop copyright and license notices from source files
[libs/datafile.git] / source / textwriter.cpp
index 08909a1c6ed952b190754063d628f4e0e3dbe3dc..0e5b6742653d80599809d645b77e1f91b9f60675 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspdatafile
-Copyright © 2007-2008, 2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <msp/io/print.h>
 #include <msp/strings/utils.h>
 #include "statement.h"
@@ -41,7 +34,13 @@ void TextWriter::write_(const Statement &st, unsigned level)
                else if(i->get_signature()==FloatType::signature)
                        out.write(format("%15g", (i->get<FloatType::Store>())));
                else if(i->get_signature()==SymbolType::signature)
-                       out.write(i->get<SymbolType::Store>().name);
+               {
+                       string name = i->get<SymbolType::Store>().name;
+                       if(isdigit(name[0]))
+                               out.write("\\"+name);
+                       else
+                               out.write(name);
+               }
        }
        if(!st.sub.empty())
        {