Commit 7a8d5070 authored by Max Kellermann's avatar Max Kellermann

Songfilter: move code to ExpectWord()

parent 8707ae6f
......@@ -274,14 +274,21 @@ FirstNonTagNameChar(const char *s) noexcept
}
static auto
ExpectFilterType(const char *&s)
ExpectWord(const char *&s)
{
const char *begin = s;
const char *end = FirstNonTagNameChar(s);
if (end == s)
throw std::runtime_error("Tag name expected");
throw std::runtime_error("Word expected");
const std::string name(s, end);
s = StripLeft(end);
return std::string(begin, end);
}
static auto
ExpectFilterType(const char *&s)
{
const auto name = ExpectWord(s);
const auto type = locate_parse_type(name.c_str());
if (type == TAG_NUM_OF_ITEM_TYPES)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment