// 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;
using System.Xml;
namespace Microsoft.Build.BuildEngine {
- internal class ConditionFactorExpression : ConditionExpression {
+ internal sealed class ConditionFactorExpression : ConditionExpression {
readonly Token token;
else if (falseValues [evaluatedToken.Value] != null)
return false;
else
- throw new InvalidOperationException ();
+ 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)
return true;
}
- private static Token EvaluateToken (Token token, Project context)
+ // FIXME: in some situations items might not be allowed
+ static Token EvaluateToken (Token token, Project context)
{
- OldExpression oe = new OldExpression (context);
- oe.ParseSource (token.Value);
- return new Token ((string) oe.ConvertTo (typeof (string)), token.Type);
+ Expression oe = new Expression ();
+ oe.Parse (token.Value, ParseOptions.AllowItemsMetadataAndSplit);
+ return new Token ((string) oe.ConvertTo (context, typeof (string)), token.Type, token.Position);
}
}
}
-
-#endif