void NxsBlock::SkipCommand(NxsToken & token) { if (nexusReader) { errormsg = "Skipping command: "; errormsg << token.GetTokenReference(); nexusReader->NexusWarnToken(errormsg, NxsReader::SKIPPING_CONTENT_WARNING, token); errormsg.clear(); } if (!token.Equals(";")) SkippingCommand(token.GetToken()); if (storeSkippedCommands) { ProcessedNxsCommand pnc; token.ProcessAsCommand(&pnc); skippedCommands.push_back(pnc); } else token.ProcessAsCommand(NULL); }
/*! Used internally to skip until teh END; or ENDBLOCK; command. */ bool NxsReader::ReadUntilEndblock(NxsToken &token, const std::string & ) { for (;; ) { token.GetNextToken(); if (token.Equals("END") || token.Equals("ENDBLOCK")) { token.GetNextToken(); if (!token.Equals(";")) { std::string errormsg = "Expecting ';' after END or ENDBLOCK command, but found "; errormsg += token.GetToken(); errormsg += " instead"; NexusError(NxsString(errormsg.c_str()), token.GetFilePosition(), token.GetFileLine(), token.GetFileColumn()); return false; } return true; } else { token.ProcessAsCommand(NULL); } } }