diff --git a/docs/BOSS Metadata File Syntax.html b/docs/BOSS Metadata File Syntax.html index e01b7b63..fc04275b 100644 --- a/docs/BOSS Metadata File Syntax.html +++ b/docs/BOSS Metadata File Syntax.html @@ -310,6 +310,7 @@ becomes
C or C and C or C( ( C or ( C and C ) ) or C )
C or C and C and C( C or ( ( C and C ) and C ) )
+You can also explicitly enclose any condition in brackets to override the evaluation order, eg. C and ( C or C ) is evaluated as C and ( C or C ) (contrast with the unbracketed string above).
BOSS supports the following languages and language codes: diff --git a/src/parsers.h b/src/parsers.h index 64e46a6e..d9d8beb7 100644 --- a/src/parsers.h +++ b/src/parsers.h @@ -300,18 +300,19 @@ namespace boss { condition_grammar() : condition_grammar::base_type(expression, "condition grammar") { expression = - andStatement - >> *(qi::lit("or") >> andStatement) + andStatement [qi::labels::_val = qi::labels::_1] + >> *((qi::lit("or") >> andStatement) [qi::labels::_val = qi::labels::_val || qi::labels::_1]) ; andStatement = - condition - >> *(qi::lit("and") >> condition) + condition [qi::labels::_val = qi::labels::_1] + >> *((qi::lit("and") >> condition) [qi::labels::_val = qi::labels::_val && qi::labels::_1]) ; condition = ( qi::lit("if") >> type ) [qi::labels::_val = qi::labels::_1] | ( qi::lit("ifnot") >> type ) [qi::labels::_val = !qi::labels::_1] + | ( '(' >> expression >> ')' ) [qi::labels::_val = qi::labels::_1] //This *should* handle the "brackets override operators" rule. ; type =