Merge pull request #485 from mtausig/master
[mono.git] / mcs / class / Microsoft.Build.Engine / Microsoft.Build.BuildEngine / ConditionFactorExpresion.cs
index bb24a71f66d5d91147474e1072db477c1b816845..709fedf1ce88f40e5419b637ed4a48a64a5458eb 100644 (file)
@@ -25,8 +25,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-#if NET_2_0
-
 using System;
 using System.Collections;
 using System.Collections.Specialized;
@@ -77,7 +75,9 @@ namespace Microsoft.Build.BuildEngine {
                        else if (falseValues [evaluatedToken.Value] != null)
                                return false;
                        else
-                               throw new InvalidProjectFileException ();
+                               throw new ExpressionEvaluationException (
+                                               String.Format ("Expression \"{0}\" evaluated to \"{1}\" instead of a boolean value",
+                                                               token.Value, evaluatedToken.Value));
                }
                
                public override float NumberEvaluate (Project context)
@@ -122,10 +122,8 @@ namespace Microsoft.Build.BuildEngine {
                static Token EvaluateToken (Token token, Project context)
                {
                        Expression oe = new Expression ();
-                       oe.Parse (token.Value, true);
-                       return new Token ((string) oe.ConvertTo (context, typeof (string)), token.Type);
+                       oe.Parse (token.Value, ParseOptions.AllowItemsMetadataAndSplit);
+                       return new Token ((string) oe.ConvertTo (context, typeof (string)), token.Type, token.Position);
                }
        }
 }
-
-#endif