Exemplo n.º 1
0
 protected FieldAnnotation(string text, FilePosition filePosition, WarningList warnings) : base(text, filePosition)
 {
     if (Name == null)
     {
         warnings.Add(filePosition, WarningType.IncompleteAnnotation,
                      "{0} annotation is missing its name (1st word).", Command);
     }
     if (Description == null)
     {
         warnings.Add(filePosition, WarningType.IncompleteAnnotation,
                      "{0} annotation '{1}' is missing its description (2nd word+).", Command, Name);
     }
 }
Exemplo n.º 2
0
 public TextAnnotation(string text, FilePosition filePosition, WarningList warnings) : base(text, filePosition)
 {
     if (Value == null)
     {
         warnings.Add(filePosition, WarningType.IncompleteAnnotation,
                      "{0} annotation is missing its value.", Command);
     }
 }
Exemplo n.º 3
0
        protected ParameterAnnotation(string text, FilePosition filePosition, WarningList warnings) : base(text, filePosition)
        {
            if (Type == null)
            {
                warnings.Add(filePosition, WarningType.IncompleteAnnotation,
                             "{0} annotation is missing its type (1st word).", Command);
            }
            // Not all parameter annotations require a type or name.
            // Let the derived classes decide.

            if (Description != null && WhitespaceAfterElements[2] == " ")
            {
                // There is only a single space before the description
                warnings.Add(filePosition, WarningType.HeuristicWarning,
                             "{0} annotation has only a single space between its name ('{1}') and its description ('{2}'). This often indicates that the description is not self-contained.",
                             Command, Name, Description.GetExcerpt());
            }
        }
Exemplo n.º 4
0
 public OptionalInParameterAnnotation(string text, FilePosition filePosition, WarningList warnings)
     : base(text, filePosition, warnings)
 {
     if (Name == null)
     {
         warnings.Add(filePosition, WarningType.IncompleteAnnotation,
                      "{0} annotation with type '{1}' is missing its name (2nd word).", Command, Type);
     }
     // Let's not insist on a description for well-named parameters.
 }