/// <summary> /// Log Errors/Warnings/Messages when the compiler reports them. /// </summary> protected override bool Add(int id, string/*!*/ message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos) { string code = ErrorIdToCode(id); switch (severity.Value) { case ErrorSeverity.Values.FatalError: case ErrorSeverity.Values.Error: case ErrorSeverity.Values.WarningAsError: logger.LogError(severity.Value.ToString(), code, "", fullPath, pos.FirstLine, pos.FirstColumn, pos.LastLine, pos.LastColumn, message); break; case ErrorSeverity.Values.Warning: logger.LogWarning(severity.Value.ToString(), code, "", fullPath, pos.FirstLine, pos.FirstColumn, pos.LastLine, pos.LastColumn, message); break; } return true; }
protected override bool Add(int id, string message, ErrorSeverity severity, int group, string/*!*/ fullPath, ErrorPosition pos) { Debug.Assert(fullPath != null); PhpException.ThrowByWebCompiler(severity.ToPhpCompileError(), id, fullPath, pos.FirstLine, pos.FirstColumn, message); return true; }
protected override bool Add(int id, string message, ErrorSeverity severity, int group, string/*!*/ fullPath, ErrorPosition pos) { Debug.Assert(fullPath != null); // first line column adjustment: if (pos.FirstLine == 1) pos.FirstColumn += firstLineColumnDisplacement; Debug.WriteLine("!!!3", message); PhpException.ThrowByEval(severity.ToPhpCompileError(), fullPath, pos.FirstLine, pos.FirstColumn, message); return true; }
protected override bool Add(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos) { return sink.AddInternal(id, message, severity, group, fullPath, pos); }
protected override bool Add(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos) { if (fullPath != null) { Debug.Assert(pos.IsValid); output.Write(String.Format("{0}({1},{2}): ", fullPath, pos.FirstLine, pos.FirstColumn)); } if (id >= 0) output.WriteLine(String.Format("{0} PHP{1:d4}: {2}", severity.ToCmdString(), id, message)); else output.WriteLine(message); return true; }
/// <summary> /// Returns whether the warning has been reported. /// </summary> protected abstract bool Add(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos);
/// <summary> /// Upgrades <see cref="ErrorSeverity.Warning"/> to <see cref="ErrorSeverity.WarningAsError"/> is <see cref="TreatWarningsAsErrors"/> is enabled. /// </summary> private ErrorSeverity UpgradeSeverity(ErrorSeverity severity) { return (severity.Value == ErrorSeverity.Values.Warning && TreatWarningsAsErrors) ? ErrorSeverity.WarningAsError : severity; }
internal bool AddInternal(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos, bool increaseCount) { severity = UpgradeSeverity(severity); bool result = Add(id, message, severity, group, fullPath, pos); if (increaseCount) counts[severity]++; return result; }
internal bool AddInternal(int id, string message, ErrorSeverity severity, int group, string fullPath, ErrorPosition pos) { return AddInternal(id, message, severity, group, fullPath, pos, false); }
public ErrorInfo(int id, string messageId, WarningGroups group) { this.id = id; this.messageId = messageId; this.severity = ErrorSeverity.Warning; this.group = (int)group; }
public ErrorInfo(int id, string messageId, ErrorSeverity severity) { this.id = id; this.messageId = messageId; this.severity = severity; this.group = (int)WarningGroups.None; }