jtr/DevDisciples.Parsing/Report.cs
mdnapo 78ebafb409 - Added debounce time to requests from frontend
- Made editors full height & full width
- Applied ParsingException more consistently
2024-09-17 21:16:24 +02:00

19 lines
557 B
C#

namespace DevDisciples.Parsing;
public static class Report
{
public static Exception 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}";
}
}