X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftextwriter.cpp;h=0e5b6742653d80599809d645b77e1f91b9f60675;hb=7df5e45c7f414f6a07681dc4ec2abb63b091a309;hp=08909a1c6ed952b190754063d628f4e0e3dbe3dc;hpb=a582163d380833b1370ba067a1fd0ad5c2984723;p=libs%2Fdatafile.git diff --git a/source/textwriter.cpp b/source/textwriter.cpp index 08909a1..0e5b674 100644 --- a/source/textwriter.cpp +++ b/source/textwriter.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspdatafile -Copyright © 2007-2008, 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #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()))); else if(i->get_signature()==SymbolType::signature) - out.write(i->get().name); + { + string name = i->get().name; + if(isdigit(name[0])) + out.write("\\"+name); + else + out.write(name); + } } if(!st.sub.empty()) {