private void OnError(object sender, FileLexerErrorEventArgs eventArgs) { FileLexer fileLexer = sender as FileLexer; hasErrors = true; errorHandler.ReportFileLexerError(fileLexer?.FilePath, eventArgs); }
public static void ReportFileLexerError(this IErrorHandler errorHandler, string filePath, FileLexerErrorEventArgs fileLexerErrorEventArgs) { string messageFormat = fileLexerErrorEventArgs.Error.Message; string message = string.Format(messageFormat, fileLexerErrorEventArgs.Args); CompilerError error = new CompilerError((ushort)CompilerErrorCode.FileLexerError, message, filePath, fileLexerErrorEventArgs.Position.Position.Line, fileLexerErrorEventArgs.Position.Position.Column); errorHandler.ReportError(error); }