public void Add(ParseError error) { if (error.Type == ParseErrorType.Error) { for (int i = 0; i < Errors.Count; i++) { if (Errors[i].Type != ParseErrorType.Error) { Errors.Insert(i, error); return; } } } else if (error.Type == ParseErrorType.ErrorButRenderAllowed) { for (int i = 0; i < Errors.Count; i++) { if (Errors[i].Type == ParseErrorType.Warning) { Errors.Insert(i, error); return; } } } Errors.Add(error); }
public static ParseResult GenerateForError(ParseError error) { ParseResult result = new ParseResult(); result.Errors.Add(error); return(result); }
public bool Equals(ParseError other) { return(Message.Equals(other.Message) && Type == other.Type && ((Position == null && other.Position == null) || (Position != null && other.Position != null && Position.Equals(other.Position)))); }
public void AddErrorButRenderAllowed(string message, ErrorPositionInfo errorPositionInfo) { ParseError error = new ParseError(ParseErrorType.ErrorButRenderAllowed, message, errorPositionInfo); Add(error); }
public void AddError(string message, ErrorPositionInfo errorPositionInfo) { ParseError error = new ParseError(ParseErrorType.Error, message, errorPositionInfo); Add(error); }