public void AddFlatError(Expression <Func <string> > resourceExpression, params object[] parm) { var err = new ParserError() { Message = DotNetUtil.Msg(resourceExpression, parm), ErrorPoint = TextBuffer.NotValidPtr }; AddError(err); }
public void AddException(Exception e, Expression <Func <string> > resourceExpression, params object[] parm) { string error = DotNetUtil.Msg(resourceExpression, parm); var err = new ParserError(); string s = _textBuffer.GetLineAndColumn(out err.Line, out err.Column); err.Message = error + " " + s; err.ErrorPoint = _textBuffer.PointerNextChar; err.Ex = e; AddError(err); }
public void AddBuildError(Expression <Func <string> > resourceExpression, CodeElement elem, params object[] parm) { string error = DotNetUtil.Msg(resourceExpression, parm); var err = new ParserError(); string s = string.Empty; if (elem != null) { err.ErrorPoint = elem.SubString.From; s = " " + _textBuffer.GetLineAndColumn(out err.Line, out err.Column, err.ErrorPoint); } err.Message = error + s; AddError(err); }
/// <summary>Add an error from parserElement.</summary> /// <param name="element"></param> /// <param name="errorPoint"></param> /// <param name="wordCount"></param> /// <param name="resourceExpression"></param> /// <param name="parm"></param> /// <returns>Always false.</returns> public bool AddSyntaxError(ParserElementBase element, int errorPoint, int wordCount, Expression <Func <string> > resourceExpression, params object[] parm) { string error = DotNetUtil.Msg(resourceExpression, parm.Insert(element.GetRule(element).Name)); // AddSyntaxError( element, errorPoint, wordCount, error); var err = new ParserError(); err.WordCount = 0; err.ErrorPoint = errorPoint; err.Error = error; string s = _textBuffer.GetLineAndColumn(out err.Line, out err.Column, errorPoint); err.Message = error + " " + s; AddError(err); return(false); }
public static string BuildMsg(int line, int col, Expression <Func <string> > resourceExpression, params object[] parm) { string pos = (line > 0) ? " " + string.Format(MessageRes.LineAndCol, line, col) : string.Empty; return(DotNetUtil.Msg(resourceExpression, parm) + pos); }