Fix bogus expression tokenizer that failed at parenthesized expressions with And/Or.
[mono.git] / mcs / class / Microsoft.Build / Microsoft.Build.Internal / ExpressionParserManual.cs
index 6e5526cef301d137335613e5658c3025ed796189..83d4e9b15655ef9d13bfa1de904a655736672342 100644 (file)
@@ -105,12 +105,13 @@ namespace Microsoft.Build.Internal
                                        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)