/// <summary> /// Creates a new <see cref="TranslationResult"/> off a failed translation. /// </summary> /// <param name="node">The node that triggered an error.</param> /// <param name="diagnostic">The type of the error.</param> /// <param name="diagnosticArguments">The diagnostic arguments.</param> public static TranslationResult Error(SyntaxNode node, SoothsharpDiagnostic diagnostic, params Object[] diagnosticArguments) { // ReSharper disable once UseObjectOrCollectionInitializer TranslationResult r = new TranslationResult(); r.Silvernode = new ErrorSilvernode(node); r.Errors.Add(new Error(diagnostic, node, diagnosticArguments)); return(r); }
public Error(SoothsharpDiagnostic diagnostic, SyntaxNode node, params object[] diagnosticArguments) { this.Diagnostic = diagnostic; this.DiagnosticArguments = diagnosticArguments; this.Node = node; }
public static TranslationProcessResult Error(SyntaxNode syntaxNode, SoothsharpDiagnostic diagnostic, params object[] arguments) { return(new TranslationProcessResult(null, new List <Error> { new Error(diagnostic, syntaxNode, arguments) })); }