Example #1
0
		internal override void ReportError(ErrorSink/*!*/ sink, ErrorInfo error)
		{
			if (declaration != null)
				sink.Add(error, declaration.SourceUnit, declaration.Position);
		}
Example #2
0
		internal override void ReportError(ErrorSink/*!*/ sink, ErrorInfo error)
		{
			if (sourceUnit != null)
				sink.Add(error, SourceUnit, position);
		}
Example #3
0
		private void Add(ErrorInfo info, string/*!*/ message, SourceUnit sourceUnit, Position pos)
		{
			Debug.Assert(message != null);
			
			string full_path;
			ErrorPosition mapped_pos;

			// missing source unit means the file name shouldn't be reported (it is not available)
			if (sourceUnit != null)
			{
				full_path = sourceUnit.GetMappedFullSourcePath(pos.FirstLine);
				mapped_pos = new ErrorPosition(
					sourceUnit.GetMappedLine(pos.FirstLine), pos.FirstColumn,
					sourceUnit.GetMappedLine(pos.LastLine), pos.LastColumn);
			}
			else
			{
				full_path = null;
				mapped_pos = ErrorPosition.Invalid;
			}

			// filter disabled warnings:
			if (info.Id < 0 || (info.Group & (int)disabledGroups) == 0 && Array.IndexOf(disabledWarnings, info.Id) == -1)
			{
				// do not count disabled warnings and related locations et. al.:
                var severity = UpgradeSeverity(info.Severity);
                if (Add(info.Id, message, severity, info.Group, full_path, mapped_pos) && info.Id >= 0)
					counts[severity]++;
			}		
		}
Example #4
0
		private void Add(ErrorInfo info, string/*!*/ message, string fullPath, ErrorPosition pos, params string[] args)
		{
			Debug.Assert(message != null);

            var severity = UpgradeSeverity(info.Severity);

            if (Add(info.Id, message, severity, info.Group, fullPath, pos) && info.Id >= 0)
                counts[severity]++;
		}
Example #5
0
		internal void Add(ErrorInfo info, string fullPath, ErrorPosition pos, string arg1, string arg2, string arg3)
		{
			Add(info, CoreResources.GetString(info.MessageId, arg1, arg2, arg3), fullPath, pos);
		}
Example #6
0
		internal void Add(ErrorInfo info, string fullPath, ErrorPosition pos, params string[] args)
		{
			Add(info, CoreResources.GetString(info.MessageId, args), fullPath, pos);
		}
Example #7
0
		internal void Add(ErrorInfo info, SourceUnit sourceUnit, Position pos, object arg1, object arg2, object arg3)
		{
			Add(info, CoreResources.GetString(info.MessageId, arg1, arg2, arg3), sourceUnit, pos);
		}
Example #8
0
		internal void Add(ErrorInfo info, SourceUnit sourceUnit, Position pos, params string[] args)
		{
			Add(info, CoreResources.GetString(info.MessageId, args), sourceUnit, pos);
		}
Example #9
0
        /// <summary>CTor from <see cref="ErrorInfo"/>, inner exception and parameters</summary>
        /// <param name="errorInfo">Information about error</param>
        /// <param name="innerException">Exception that caused this exception to be thrown</param>
        /// <param name="errorParams">Error parameters</param>
        internal CompilerException(ErrorInfo errorInfo, Exception innerException, params string[]/*!*/ errorParams)
            :base(errorInfo.ToString(),innerException){
            Debug.Assert(errorParams != null);

            this.errorInfo = errorInfo;
            this.errorParams = errorParams;
        }
Example #10
0
		internal CompilerException(ErrorInfo errorInfo, params string[]/*!*/ errorParams)
		{
			Debug.Assert(errorParams != null);
			
			this.errorInfo = errorInfo;
			this.errorParams = errorParams;
		}
Example #11
0
		internal CompilerException()
		{
			errorInfo = FatalErrors.InternalError;
			errorParams = ArrayUtils.EmptyStrings;
		}
Example #12
0
 internal void Add(ErrorInfo info, SourceUnit sourceUnit, Text.Span pos, object arg1, object arg2)
 {
     Add(info, CoreResources.GetString(info.MessageId, arg1, arg2), sourceUnit, pos);
 }
Example #13
0
 internal void Add(ErrorInfo info, SourceUnit sourceUnit, Text.Span pos)
 {
     Add(info, CoreResources.GetString(info.MessageId), sourceUnit, pos);
 }