当前位置: 首页>>代码示例>>C#>>正文


C# ErrorSink.Add方法代码示例

本文整理汇总了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;
		}
开发者ID:Ashod,项目名称:Phalanger,代码行数:16,代码来源:TypeDecl.cs

示例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;
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:20,代码来源:TypeRef.cs

示例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;
		}
开发者ID:proff,项目名称:Phalanger,代码行数:19,代码来源:NewAndInstanceof.cs

示例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;
		}
开发者ID:MpApQ,项目名称:Phalanger,代码行数:20,代码来源:CompilationUnits.cs

示例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;
			}
		}
开发者ID:MpApQ,项目名称:Phalanger,代码行数:11,代码来源:CompilationUnits.cs

示例6: ReportCircularDefinition

		internal override void ReportCircularDefinition(ErrorSink/*!*/ errors)
		{
			errors.Add(Errors.CircularConstantDefinitionClass, SourceUnit, Span, DeclaringType.FullName, FullName);
		}
开发者ID:kendallb,项目名称:Phalanger,代码行数:4,代码来源:Constants.cs

示例7: ReportRedeclaration

		public void ReportRedeclaration(ErrorSink/*!*/ errors)
		{
			errors.Add(FatalErrors.ConstantRedeclared, SourceUnit, Span, FullName);
		}
开发者ID:kendallb,项目名称:Phalanger,代码行数:4,代码来源:Constants.cs


注:本文中的ErrorSink.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。