本文整理汇总了C#中ErrorSink.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorSink.Add方法的具体用法?C# ErrorSink.Add怎么用?C# ErrorSink.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorSink
的用法示例。
在下文中一共展示了ErrorSink.Add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Merge
internal bool Merge(ErrorSink/*!*/ errors, FormalTypeParam/*!*/ other)
{
if (this.name != other.Name)
{
PhpType declaring_type = (PhpType)parameter.DeclaringMember;
errors.Add(Errors.PartialDeclarationsDifferInTypeParameter, declaring_type.Declaration.SourceUnit,
position, declaring_type.FullName);
return false;
}
attributes.Merge(other.Attributes);
return true;
}
示例2: ToStaticTypeRefs
internal static object[]/*!!*/ ToStaticTypeRefs(List<TypeRef>/*!*/ typeRefs, ErrorSink errors, SourceUnit sourceUnit)
{
if (typeRefs == null || typeRefs.Count == 0)
return ArrayUtils.EmptyObjects;
object[] result = new object[typeRefs.Count];
for (int i = 0; i < typeRefs.Count; i++)
{
if ((result[i] = typeRefs[i].ToStaticTypeRef(errors, sourceUnit)) == null)
{
if (errors != null)
errors.Add(Errors.GenericParameterMustBeType, sourceUnit, typeRefs[i].Span);
result[i] = new PrimitiveTypeName(QualifiedName.Object);
}
}
return result;
}
示例3: ToStaticTypeRefs
internal static object[]/*!!*/ ToStaticTypeRefs(List<TypeRef>/*!*/ typeRefs, ErrorSink/*!*/ errors, SourceUnit/*!*/ sourceUnit)
{
if (typeRefs.Count == 0) return ArrayUtils.EmptyObjects;
object[] result = new object[typeRefs.Count];
for (int i = 0; i < typeRefs.Count; i++)
{
result[i] = typeRefs[i].ToStaticTypeRef(errors, sourceUnit);
if (result[i] == null)
{
errors.Add(Errors.GenericParameterMustBeType, sourceUnit, typeRefs[i].Position);
result[i] = PrimitiveType.Object;
}
}
return result;
}
示例4: CheckDeclaration
protected bool CheckDeclaration(ErrorSink/*!*/ errors, IDeclaree/*!*/ member, Declaration/*!*/ existing)
{
Declaration current = member.Declaration;
if (existing.IsPartial ^ current.IsPartial)
{
TryFixPartial(errors, current, existing);
TryFixPartial(errors, existing, current);
}
if ((!existing.IsPartial || !current.IsPartial) && (!existing.IsConditional || !current.IsConditional))
{
// report fatal error (do not throw an exception, just don't let the analysis continue):
member.ReportRedeclaration(errors);
errors.Add(FatalErrors.RelatedLocation, existing.SourceUnit, existing.Position);
return false;
}
return true;
}
示例5: TryFixPartial
private void TryFixPartial(ErrorSink/*!*/ errors, Declaration/*!*/ first, Declaration/*!*/ second)
{
if (!first.IsPartial && !first.IsConditional)
{
// report error and mark the declaration partial:
errors.Add(Errors.MissingPartialModifier, first.SourceUnit, first.Position, first.Declaree.FullName);
errors.Add(Errors.RelatedLocation, second.SourceUnit, second.Position);
first.IsPartial = true;
}
}
示例6: ReportCircularDefinition
internal override void ReportCircularDefinition(ErrorSink/*!*/ errors)
{
errors.Add(Errors.CircularConstantDefinitionClass, SourceUnit, Span, DeclaringType.FullName, FullName);
}
示例7: ReportRedeclaration
public void ReportRedeclaration(ErrorSink/*!*/ errors)
{
errors.Add(FatalErrors.ConstantRedeclared, SourceUnit, Span, FullName);
}