X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftextparser.cpp;fp=source%2Ftextparser.cpp;h=8bcde35802108ba2f16c32584e6ace17b1e33ee9;hb=a582163d380833b1370ba067a1fd0ad5c2984723;hp=d8e422ee7ff4d4d710a764a62383955f377305f5;hpb=cbd0ddd6ee033e46646bfb85d19232c816ea1eda;p=libs%2Fdatafile.git diff --git a/source/textparser.cpp b/source/textparser.cpp index d8e422e..8bcde35 100644 --- a/source/textparser.cpp +++ b/source/textparser.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspdatafile -Copyright © 2007-2008 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2008, 2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -77,20 +77,19 @@ Statement TextParser::parse_statement(const Token *t) else if(token.str==";") break; else if(token.type==Token::INTEGER) - result.args.push_back(Value(INTEGER, token.str)); + result.append(lexical_cast(token.str)); else if(token.type==Token::FLOAT) - result.args.push_back(Value(FLOAT, token.str)); + result.append(lexical_cast(token.str)); else if(token.type==Token::STRING) - result.args.push_back(Value(STRING, token.str)); + result.append(token.str); else if(token.type==Token::IDENTIFIER) { if(token.str=="true") - result.args.push_back(Value(BOOLEAN, "1")); + result.append(true); else if(token.str=="false") - result.args.push_back(Value(BOOLEAN, "0")); + result.append(false); else - result.args.push_back(Value(ENUM, token.str)); - //result.args.push_back(resolve_identifiertoken.str); + result.append(Symbol(token.str)); } else if(token.str=="") throw_at(ParseError("Unexcepted end of input"), get_location());