X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fparser.cpp;h=7b9af11d60ca292a860ae346cebcb813220e5469;hb=36e888dd1208822ae6df13b63f32c97d36b0a616;hp=ef2daa3e0ab8bd5dbb75ce8696a64c789c8417ab;hpb=52b69f7841d3b2ca0bb83c04214f30c7d1c6a615;p=libs%2Fdatafile.git diff --git a/source/parser.cpp b/source/parser.cpp index ef2daa3..7b9af11 100644 --- a/source/parser.cpp +++ b/source/parser.cpp @@ -1,6 +1,6 @@ /* This file is part of libmspparser -Copyright © 2006 Mikko Rasa, Mikkosoft Productions +Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ #include @@ -96,6 +96,12 @@ Statement Parser::parse_(const Token *t) result.args.push_back(Value(Value::STRING, token.str)); else if(token.type==Token::IDENTIFIER) { + if(token.str=="true") + result.args.push_back(Value(Value::BOOLEAN, "1")); + else if(token.str=="false") + result.args.push_back(Value(Value::BOOLEAN, "0")); + else + result.args.push_back(Value(Value::ENUM, token.str)); //result.args.push_back(resolve_identifiertoken.str); } else if(token.str=="") @@ -335,7 +341,7 @@ string Parser::get_location() void Parser::parse_error(int c, int state) { ostringstream ss; - ss<