Refactored Json2CSharpTranslator

This commit is contained in:
2024-09-29 19:57:31 +02:00
parent dc7fda1eed
commit 585447193d
8 changed files with 122 additions and 59 deletions

View File

@@ -86,15 +86,15 @@ public class ParserContext<TToken> : ParsableStream<Lexer<TToken>.Token> where T
public Lexer<TToken>.Token Consume(TToken type, string message)
{
if (Check(type)) return Advance();
throw Error(message);
throw SyntaxException(message);
}
public Exception Error(string message)
public Exception SyntaxException(string message)
{
return new SyntaxException(Report.FormatMessage(Current, message));
}
public Exception Error(Lexer<TToken>.Token token, string message)
public Exception SyntaxException(Lexer<TToken>.Token token, string message)
{
return new SyntaxException(Report.FormatMessage(token, message));
}