/// <summary> /// Translates a Z80AsmParserErrorInfo instance into an error /// </summary> /// <param name="sourceItem"> /// Source file information, to allow the error to track the filename the error occurred in /// </param> /// <param name="error">Error information</param> private void ReportError(SourceFileItem sourceItem, Z80AsmParserErrorInfo error) { var errInfo = new AssemblerErrorInfo(sourceItem, error); Output.Errors.Add(errInfo); ReportScopeError(errInfo.ErrorCode); }
public AssemblerErrorInfo(SourceFileItem sourceItem, Z80AsmParserErrorInfo syntaxErrorInfo) { var token = syntaxErrorInfo.Token.Trim(); ErrorCode = token.Length == 0 ? Errors.Z0101 : Errors.Z0100; Line = syntaxErrorInfo.SourceLine; Column = syntaxErrorInfo.Position; Message = Errors.GetMessage(ErrorCode, token); Filename = sourceItem.Filename; }
/// <summary> /// Translates a Z80AsmParserErrorInfo instance into an error /// </summary> /// <param name="sourceItem"> /// Source file information, to allow the error to track the filename the error ocurred in /// </param> /// <param name="error">Error information</param> private void ReportError(SourceFileItem sourceItem, Z80AsmParserErrorInfo error) { _output.Errors.Add(new AssemblerErrorInfo(sourceItem, error)); }