1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:23:53 +00:00

added support for half-sided intervals to filter parser

This commit is contained in:
Marc Zinnschlag 2013-09-05 15:38:28 +02:00
parent f3ce9c22a1
commit 645b50ef36

View file

@ -461,17 +461,23 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
token = getNextToken(); token = getNextToken();
if (token.mType!=Token::Type_Number) if (token.mType==Token::Type_Number)
{ {
error(); lower = token.mNumber;
return boost::shared_ptr<Node>();
token = getNextToken();
if (token.mType!=Token::Type_Comma)
{
error();
return boost::shared_ptr<Node>();
}
} }
else if (token.mType==Token::Type_Comma)
lower = token.mNumber; {
lowerType = ValueNode::Type_Infinite;
token = getNextToken(); }
else
if (token.mType!=Token::Type_Comma)
{ {
error(); error();
return boost::shared_ptr<Node>(); return boost::shared_ptr<Node>();
@ -479,18 +485,20 @@ boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseValue()
token = getNextToken(); token = getNextToken();
if (token.mType!=Token::Type_Number) if (token.mType==Token::Type_Number)
{ {
error(); upper = token.mNumber;
return boost::shared_ptr<Node>();
token = getNextToken();
} }
else
upper = token.mNumber; upperType = ValueNode::Type_Infinite;
token = getNextToken();
if (token.mType==Token::Type_CloseSquare) if (token.mType==Token::Type_CloseSquare)
upperType = ValueNode::Type_Closed; {
if (upperType!=ValueNode::Type_Infinite)
upperType = ValueNode::Type_Closed;
}
else if (token.mType!=Token::Type_OpenSquare && token.mType!=Token::Type_Close) else if (token.mType!=Token::Type_OpenSquare && token.mType!=Token::Type_Close)
{ {
error(); error();