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:
parent
f3ce9c22a1
commit
645b50ef36
1 changed files with 25 additions and 17 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue