jtr/Jtr.Parsing/Report.cs
mdnapo 96c203f842
All checks were successful
Run the JSON parser tests / test (push) Has been skipped
Moved UI to separate project, added Dockerfile & renamed project
2024-10-19 12:04:40 +02:00

19 lines
568 B
C#

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}";
}
}