namespace Jtr.Parsing; public static class Report { public static SyntaxException SyntaxException(ISourceLocation token, string message) { return new SyntaxException(FormatMessage(token, message)); } public static void SyntaxHalt(ISourceLocation token, string message) { throw new SyntaxException(FormatMessage(token, message)); } public static string FormatMessage(ISourceLocation token, string msg) { return $"{token.File}\n\t[line: {token.Line}, column: {token.Column}] {msg}"; } }