Exemplo n.º 1
0
 public WarningInfo(WarningID id, WarningLevel level, string name, string description)
 {
     ID = id;
     Level = level;
     Name = name;
     Description = description;
 }
Exemplo n.º 2
0
 // 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];
 }
Exemplo n.º 3
0
 private void ReportWarning(WarningID id, WarningLocation location, string value, string message)
 => SourceFile.ParsingResult.ParserWarnings.Add(
     new Warning(
         id,
         location,
         value,
         message,
         ParserIdentifier));
Exemplo n.º 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);
 }
Exemplo n.º 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));
Exemplo n.º 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);
Exemplo n.º 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));
Exemplo n.º 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);
Exemplo n.º 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));
Exemplo n.º 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);