X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinaryparser.cpp;h=ba6414bc77a369a7eb2d7c51e06e412aee16fb0a;hb=a02c84384a101c0dec48b6aa2dee53bac4bbd034;hp=298770a50f3ccbf2b02d3113f0163daea0dfefa7;hpb=27630d44298cb67e075c166f4421288cc8ca117e;p=libs%2Fdatafile.git diff --git a/source/binaryparser.cpp b/source/binaryparser.cpp index 298770a..ba6414b 100644 --- a/source/binaryparser.cpp +++ b/source/binaryparser.cpp @@ -19,7 +19,7 @@ BinaryParser::BinaryParser(Input &i, const string &s): ParserMode(i, s), first(true) { - dict[1]=DictEntry("__kw", "iss"); + dict[1]=DictEntry("__st", "iss"); dict[2]=DictEntry("__enum", "is"); } @@ -28,7 +28,7 @@ Statement BinaryParser::parse() while(1) { Statement st=parse_statement(); - if(st.keyword=="__kw") + if(st.keyword=="__st") { if(st.args.size()!=3) throw TypeError(src+": Keyword definition must have three arguments"); @@ -87,7 +87,7 @@ Statement BinaryParser::parse_statement() result.args.push_back(parse_bool()); break; case 'e': - result.args.push_back(parse_enum()); + result.args.push_back(Value(ENUM, parse_enum())); break; } } @@ -132,7 +132,7 @@ float BinaryParser::parse_float() }; #if BYTE_ORDER == LITTLE_ENDIAN - for(unsigned i=sizeof(float)-1; i--;) + for(unsigned i=sizeof(float); i--;) d[i]=in.get(); #else for(unsigned i=0; isecond; }