Imported Upstream version 3.8.0

Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
This commit is contained in:
Jo Shields
2014-09-04 09:07:35 +01:00
parent a575963da9
commit fe777c5c82
1062 changed files with 12460 additions and 5983 deletions

View File

@@ -346,12 +346,12 @@ namespace Microsoft.Build.Internal.Expressions
var args = Access.Arguments.Select (e => e.EvaluateAsObject (context)).ToArray ();
var method = FindMethod (type, Access.Name.Name, args);
if (method == null)
throw new InvalidProjectFileException (Location, string.Format ("access to undefined static method '{0}' of '{1}' at {2}", Access.Name.Name, Access.Target.EvaluateAsString (context), Location));
throw new InvalidProjectFileException (Location, string.Format ("access to undefined static method '{0}' of '{1}' at {2}", Access.Name.Name, type, Location));
return method.Invoke (null, AdjustArgsForCall (method, args));
} else {
var prop = type.GetProperty (Access.Name.Name);
if (prop == null)
throw new InvalidProjectFileException (Location, string.Format ("access to undefined static property '{0}' of '{1}' at {2}", Access.Name.Name, Access.Target.EvaluateAsString (context), Location));
throw new InvalidProjectFileException (Location, string.Format ("access to undefined static property '{0}' of '{1}' at {2}", Access.Name.Name, type, Location));
return prop.GetValue (null, null);
}
}
@@ -491,6 +491,30 @@ namespace Microsoft.Build.Internal.Expressions
return EvaluateAsString (context);
}
}
partial class QuotedExpression : Expression
{
public override string EvaluateAsString (EvaluationContext context)
{
return QuoteChar + EvaluateAsStringWithoutQuote (context) + QuoteChar;
}
public string EvaluateAsStringWithoutQuote (EvaluationContext context)
{
return string.Concat (Contents.Select (e => e.EvaluateAsString (context)));
}
public override bool EvaluateAsBoolean (EvaluationContext context)
{
var ret = EvaluateAsStringWithoutQuote (context);
return EvaluateStringAsBoolean (context, ret);
}
public override object EvaluateAsObject (EvaluationContext context)
{
return EvaluateAsStringWithoutQuote (context);
}
}
partial class FunctionCallExpression : Expression
{