Example #1
0
 /// <summary>
 /// Initialize
 /// </summary>
 /// <param name="errorType">Type of the error. "Syntax Error"</param>
 /// <param name="error">Error message</param>
 /// <param name="scriptpath">Path of the script</param>
 /// <param name="lineNumber">Line number of the error.</param>
 /// <param name="charPos">The char position of the error.</param>
 public LangException(string errorType, string error, string scriptpath, int lineNumber, int charPos = 0)
     : base(error)
 {
     Error = new ScriptError();
     Error.Line = lineNumber;
     Error.Message = error;
     Error.ErrorType = errorType;
     Error.File = scriptpath;
     Error.Column = charPos;
 }
Example #2
0
 /// <summary>
 /// Add the specified error and source position of the expression
 /// </summary>
 /// <param name="errorCode">The distinct error code.</param>
 /// <param name="errorText">Error text</param>
 /// <param name="node">The expression associated with the warning</param>
 /// <param name="errorType">Type of error.</param>
 private void AddSemanticError(string errorCode, string errorText, AstNode node, ScriptErrorType errorType)
 {
     string errormsg = errorText + " at line : " + node.Ref.Line + ", pos : " + node.Ref.CharPos;
     var error = new ScriptError();
     error.Line = node.Ref.Line;
     error.File = node.Ref.ScriptName;
     error.Column = node.Ref.CharPos;
     error.ErrorType = errorType.ToString();
     error.ErrorCode = errorCode;
     error.Message = errormsg;
     _errors.Add(error);
 }