This commit is contained in:
Jelle Luteijn 2022-05-15 11:19:49 +02:00
parent 16e76d6b31
commit 484dbfc9d9
529 changed files with 113694 additions and 0 deletions

View file

@ -0,0 +1,28 @@
namespace AspClassic.Scripting;
public class ErrorSink
{
public static readonly ErrorSink Default = new ErrorSink();
public static readonly ErrorSink Null = new NullErrorSink();
protected ErrorSink()
{
}
public virtual void Add(SourceUnit source, string message, SourceSpan span, int errorCode, Severity severity)
{
if (severity == Severity.FatalError || severity == Severity.Error)
{
throw new SyntaxErrorException(message, source, span, errorCode, severity);
}
}
public virtual void Add(string message, string path, string code, string line, SourceSpan span, int errorCode, Severity severity)
{
if (severity == Severity.FatalError || severity == Severity.Error)
{
throw new SyntaxErrorException(message, path, code, line, span, errorCode, severity);
}
}
}