Refactored Json2CSharpTranslator
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user