Small cleanup
This commit is contained in:
@@ -448,28 +448,28 @@ BPackageInfo::Parser::_ParseStringList(BObjectList<BString>* value,
|
|||||||
BObjectList<BString>* value;
|
BObjectList<BString>* value;
|
||||||
bool allowQuotedStrings;
|
bool allowQuotedStrings;
|
||||||
|
|
||||||
StringParser(BObjectList<BString>* value_, bool allowQuotedStrings_)
|
StringParser(BObjectList<BString>* value, bool allowQuotedStrings)
|
||||||
:
|
:
|
||||||
value(value_),
|
value(value),
|
||||||
allowQuotedStrings(allowQuotedStrings_)
|
allowQuotedStrings(allowQuotedStrings)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void operator()(const Token& token)
|
virtual void operator()(const Token& token)
|
||||||
{
|
{
|
||||||
if (allowQuotedStrings) {
|
if (allowQuotedStrings) {
|
||||||
if (token.type != TOKEN_QUOTED_STRING
|
if (token.type != TOKEN_QUOTED_STRING
|
||||||
&& token.type != TOKEN_WORD) {
|
&& token.type != TOKEN_WORD) {
|
||||||
throw ParseError("expected quoted-string or word",
|
throw ParseError("expected quoted-string or word",
|
||||||
token.pos);
|
token.pos);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (token.type != TOKEN_WORD)
|
if (token.type != TOKEN_WORD)
|
||||||
throw ParseError("expected word", token.pos);
|
throw ParseError("expected word", token.pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
value->AddItem(new BString(token.text));
|
value->AddItem(new BString(token.text));
|
||||||
}
|
}
|
||||||
} stringParser(value, allowQuotedStrings);
|
} stringParser(value, allowQuotedStrings);
|
||||||
|
|
||||||
_ParseList(stringParser);
|
_ParseList(stringParser);
|
||||||
|
|||||||
Reference in New Issue
Block a user