Added (Boolean|Integer)Expression subclasses of VariableExpression
This commit is contained in:
@@ -29,13 +29,13 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (typeof(IEnumerable<string>).IsAssignableFrom(type))
|
||||
return fieldInfo.GetValue(ruleInfo) as IEnumerable<string>;
|
||||
|
||||
if (type == typeof(VariableExpression))
|
||||
if (type == typeof(BooleanExpression) || type == typeof(IntegerExpression))
|
||||
{
|
||||
var expr = (VariableExpression)fieldInfo.GetValue(ruleInfo);
|
||||
return expr != null ? expr.Variables : Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
throw new InvalidOperationException("Bad type for reference on {0}.{1}. Supported types: string, IEnumerable<string>, BooleanExpression"
|
||||
throw new InvalidOperationException("Bad type for reference on {0}.{1}. Supported types: string, IEnumerable<string>, BooleanExpression, IntegerExpression"
|
||||
.F(ruleInfo.GetType().Name, fieldInfo.Name));
|
||||
}
|
||||
|
||||
@@ -48,13 +48,13 @@ namespace OpenRA.Mods.Common.Lint
|
||||
if (typeof(IEnumerable).IsAssignableFrom(type))
|
||||
return (IEnumerable<string>)propertyInfo.GetValue(ruleInfo);
|
||||
|
||||
if (type == typeof(VariableExpression))
|
||||
if (type == typeof(BooleanExpression) || type == typeof(IntegerExpression))
|
||||
{
|
||||
var expr = (VariableExpression)propertyInfo.GetValue(ruleInfo);
|
||||
return expr != null ? expr.Variables : Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
throw new InvalidOperationException("Bad type for reference on {0}.{1}. Supported types: string, IEnumerable<string>, BooleanExpression"
|
||||
throw new InvalidOperationException("Bad type for reference on {0}.{1}. Supported types: string, IEnumerable<string>, BooleanExpression, IntegerExpression"
|
||||
.F(ruleInfo.GetType().Name, propertyInfo.Name));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user