public SyntaxError( bool endOfInput, [NotNull] string text, [NotNull] string errorText, [NotNull] ITextContext context, [CanBeNull] SyntaxError innerError = null) { if (text == null) { throw new ArgumentNullException(nameof(text)); } if (errorText == null) { throw new ArgumentNullException(nameof(errorText)); } if (context == null) { throw new ArgumentNullException(nameof(context)); } EndOfInput = endOfInput; Text = text; ErrorText = errorText; Context = context; if (innerError != null) { InnerError = innerError; } }
private ReadResult([NotNull] SyntaxError error) { if (error == null) { throw new ArgumentNullException(nameof(error)); } Error = error; Text = string.Empty; ErrorText = error.ErrorText; EndOfInput = error.EndOfInput; Success = false; Text = error.Text; }
public static ReadResult <T> FromSyntaxError([NotNull] SyntaxError error) { return(new ReadResult <T>(error)); }