{
class ExpressionParser
{
- const int yacc_verbose_flag = 0;
+ static readonly int yacc_verbose_flag = Environment.GetEnvironmentVariable ("MONO_MSBUILD_PARSER_DEBUG") == "1" ? 1 : 0;
object debug_obj = yacc_verbose_flag == 0 ? null : new yydebug.yyDebugSimple ();
| MetadataAccessExpression
| RawStringLiteralOrFunction
| ParenthesizedExpression
+ ;
BooleanLiteral
: TRUE_LITERAL
goto default;
start++;
last = FindMatchingCloseParen (start, end);
- if (last < 0)
- if (validation_type == ExpressionValidationType.StrictBoolean)
- throw new InvalidProjectFileException (string.Format ("expression did not have matching ')' since index {0} in \"{1}\"", start, source));
- else {
- start--;
- goto default; // treat as raw literal to the section end
+ if (last < 0) {
+ if (validation_type == ExpressionValidationType.StrictBoolean)
+ throw new InvalidProjectFileException (string.Format ("expression did not have matching ')' since index {0} in \"{1}\"", start, source));
+ else {
+ start--;
+ goto default; // treat as raw literal to the section end
+ }
}
var contents = Parse (start, last).ToArray ();
if (contents.Length > 1)
TokenForItemPropertyValue ("]", Token.BRACE_CLOSE);
break;
case '(':
+ modes.Push (TokenizerMode.Default);
TokenForItemPropertyValue ("(", Token.PAREN_OPEN);
break;
case ')':
"$([System.String]::Format('True'))",
"$([System.String]::Format('True', null))",
"False And True == True And True",
+ "True or True or False",
+ "(True or True or False)",
+ "True and False",
+ "(True) and (False)",
};
string [] depends = {
// valid only if evaluated to boolean