Constant ReadDecimalConstant(IList<CustomAttributeData> attrs)
{
if (attrs.Count == 0)
return null;
string name, ns;
foreach (var ca in attrs) {
GetCustomAttributeTypeName (ca, out ns, out name);
if (name != "DecimalConstantAttribute" || ns != CompilerServicesNamespace)
continue;
var value = new decimal (
(int) (uint) ca.ConstructorArguments[4].Value,
(int) (uint) ca.ConstructorArguments[3].Value,
(int) (uint) ca.ConstructorArguments[2].Value,
(byte) ca.ConstructorArguments[1].Value != 0,
(byte) ca.ConstructorArguments[0].Value);
return new DecimalConstant (value, Location.Null).Resolve (null);
}
return null;
}