#include <msp/strings/format.h>
#include "binaryparser.h"
-#include "dataerror.h"
+#include "except.h"
#include "parser.h"
#include "statement.h"
#include "textparser.h"
mode->process_control_statement(st);
}
+const StatementKey *Parser::peek(unsigned level)
+{
+ while(good)
+ {
+ const StatementKey *key = mode->peek(level);
+ if(key && !key->keyword.compare(0, 2, "__"))
+ process_control_statement(mode->parse());
+ else
+ return key;
+ }
+
+ return 0;
+}
+
+bool Parser::parse_and_load(unsigned level, Loader &ldr, const LoaderAction &act)
+{
+ // Peek first to get any control statements processed
+ peek(level);
+ return mode->parse_and_load(level, ldr, act);
+}
+
} // namespace DataFile
} // namespace Msp