Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public static ParseResult GenerateForError(ParseError error)
        {
            ParseResult result = new ParseResult();

            result.Errors.Add(error);
            return(result);
        }
Esempio n. 3
0
 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))));
 }
Esempio n. 4
0
        public void AddErrorButRenderAllowed(string message, ErrorPositionInfo errorPositionInfo)
        {
            ParseError error = new ParseError(ParseErrorType.ErrorButRenderAllowed, message, errorPositionInfo);

            Add(error);
        }
Esempio n. 5
0
        public void AddError(string message, ErrorPositionInfo errorPositionInfo)
        {
            ParseError error = new ParseError(ParseErrorType.Error, message, errorPositionInfo);

            Add(error);
        }