]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/parser.cpp
Move all exception classes to a common header
[libs/datafile.git] / source / parser.cpp
index 9ad70d8742884bfdfa40d5bebbc467b9e289afe7..5972e2d98f832d312afa4373bfe66d4204d10f8f 100644 (file)
@@ -1,6 +1,6 @@
 #include <msp/strings/format.h>
 #include "binaryparser.h"
-#include "dataerror.h"
+#include "except.h"
 #include "parser.h"
 #include "statement.h"
 #include "textparser.h"
@@ -88,7 +88,7 @@ void Parser::process_control_statement(const Statement &st)
 
 const StatementKey *Parser::peek(unsigned level)
 {
-       while(1)
+       while(good)
        {
                const StatementKey *key = mode->peek(level);
                if(key && !key->keyword.compare(0, 2, "__"))
@@ -96,6 +96,8 @@ const StatementKey *Parser::peek(unsigned level)
                else
                        return key;
        }
+
+       return 0;
 }
 
 bool Parser::parse_and_load(unsigned level, Loader &ldr, const LoaderAction &act)