X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftextparser.cpp;h=afa78b99927ddb67c581f47484b9cefc1c567a7e;hb=2f73f948cd2f4bb0bdcc0f5f81816fb169819879;hp=c4eb03c7d91ef21e2b1af8d707e2f1363cc7fc4e;hpb=d14b7ddd81404b909a4c4763a36a23b94998a089;p=libs%2Fdatafile.git diff --git a/source/textparser.cpp b/source/textparser.cpp index c4eb03c..afa78b9 100644 --- a/source/textparser.cpp +++ b/source/textparser.cpp @@ -35,7 +35,7 @@ TextParser::TextParser(Input &i, const string &s): ParserMode(i, s) { } -Statement TextParser::parse() +Statement TextParser::parse(bool) { return parse_statement(0); } @@ -124,9 +124,9 @@ Token TextParser::parse_token() c = in.get(); int next = in.peek(); - if(c=='/' && next=='/') + if(c=='/' && next=='/' && !comment) comment = 1; - else if(c=='/' && next=='*') + else if(c=='/' && next=='*' && !comment) comment = 2; else if(c=='\n' && comment==1) comment = 0; @@ -237,6 +237,8 @@ Token TextParser::parse_token() case DECIMAL: if(c=='.') state = FLOAT; + else if(c=='e' || c=='E') + state = FLOATEXPINIT; else if(!isdigit(c)) throw parse_error(buf); break;