public TestCompilerErrorInfo(string filename, Z80TestParserErrorInfo syntaxErrorInfo) { var token = syntaxErrorInfo.Token.Trim(); ErrorCode = Errors.T0001; Line = syntaxErrorInfo.SourceLine; Column = syntaxErrorInfo.Position; Message = Errors.GetMessage(ErrorCode, token); Filename = 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 static void ReportError(TestFilePlan sourceItem, Z80TestParserErrorInfo error) { sourceItem.Errors.Add(new TestCompilerErrorInfo(sourceItem.Filename, error)); }