jtr/DevDisciples.Parsing/Report.cs
mdnapo 82a59eebd2 - Refactored code
- Implemented basic JSON Path interpreter
- Clean up
2024-09-22 16:30:31 +02:00

19 lines
564 B
C#

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