예제 #1
0
 public WarningInfo(WarningID id, WarningLevel level, string name, string description)
 {
     ID = id;
     Level = level;
     Name = name;
     Description = description;
 }
예제 #2
0
파일: Warning.cs 프로젝트: edyoung/Prequel
 // use the per-warning factory methods instead
 private Warning(int line, WarningID number, string message)
 {
     this.Line = line;
     this.Number = number;
     this.Message = message;
     this.Info = WarningTypes[number];
 }
예제 #3
0
 private void ReportWarning(WarningID id, WarningLocation location, string value, string message)
 => SourceFile.ParsingResult.ParserWarnings.Add(
     new Warning(
         id,
         location,
         value,
         message,
         ParserIdentifier));
예제 #4
0
 internal ValidationReport AddWarning(WarningID id, WarningLocation location, string value, string messageFormat, params string[] messageArgs)
 {
     AddWarning(
         new Warning(
             id,
             location,
             value,
             string.Format(messageFormat, messageArgs),
             nameof(ValidationContext)));
     return(this);
 }
예제 #5
0
        public void WarningID_Equals()
        {
            var warningIdOne = new WarningID(-9001, "Foo");
            var warningIdTwo = new WarningID(-9001, "Bar");

            Assert.NotSame(warningIdOne, warningIdTwo);
            Assert.Equal(warningIdOne, warningIdTwo);

            warningIdOne = WarningIDs.EmptyCodeBlock;
            warningIdTwo = new WarningID(warningIdOne.ID, string.Empty);

            Assert.NotSame(warningIdOne, warningIdTwo);
            Assert.Equal(warningIdOne, warningIdTwo);
        }
 public RollingContextTest Assert(WarningID id, int start, int end, string value, string fileName = DefaultFileName)
 => Assert((fileName, id, start, end, value));
예제 #7
0
 /// <summary>
 /// Report a warning that applies to the entire reference
 /// </summary>
 internal void ReportWarning(WarningID id, string messageFormat, params string[] messageArgs)
 => Context.ReportWarning(id, Reference, messageFormat, messageArgs);
예제 #8
0
 /// <summary>
 /// Report a warning about a specific span of source
 /// </summary>
 public void ReportWarning(WarningID id, SourceSpan span, string value, string messageFormat, params string[] messageArgs)
 => ReportWarning(id, new WarningLocation(SourceFile, span), value, string.Format(messageFormat, messageArgs));
예제 #9
0
 /// <summary>
 /// Report a warning about a specific span of source
 /// </summary>
 public void ReportWarning(WarningID id, int start, int end, string value, string messageFormat, params string[] messageArgs)
 => ReportWarning(id, new SourceSpan(start, end), value, messageFormat, messageArgs);
예제 #10
0
 /// <summary>
 /// Report a warning that applies to the entire reference
 /// </summary>
 internal void ReportWarning(WarningID id, Reference reference, string messageFormat, params string[] messageArgs)
 => ReportWarning(id, new WarningLocation(SourceFile, reference), reference.RawReference, string.Format(messageFormat, messageArgs));
예제 #11
0
 /// <summary>
 /// Report a warning that applies to the entire parsed object
 /// </summary>
 public void ReportWarning(WarningID id, string value, string messageFormat, params string[] messageArgs)
 => ReportWarning(id, Object.Span, value, messageFormat, messageArgs);