CSMFilter::Token CSMFilter::Parser::getStringToken() { std::string string; int size = static_cast<int> (mInput.size()); for (; mIndex<size; ++mIndex) { char c = mInput[mIndex]; if (std::isalpha (c) || c==':' || c=='_' || (!string.empty() && std::isdigit (c)) || c=='"' || (!string.empty() && string[0]=='"')) string += c; else break; if (c=='"' && string.size()>1) { ++mIndex; break; } }; if (!string.empty()) { if (string[0]=='"' && (string[string.size()-1]!='"' || string.size()<2) ) { error(); return Token (Token::Type_None); } if (string[0]!='"' && string[string.size()-1]=='"') { error(); return Token (Token::Type_None); } if (string[0]=='"') return string.substr (1, string.size()-2); } return checkKeywords (string); }
void checkKeywords(const Deck& deck) { checkKeywords(deck, ParseContext(), ErrorGuard()); }
void checkKeywords(const Deck& deck, const ParseContext& parseContext, T&& errorGuard) { checkKeywords(deck, parseContext, errorGuard); }