tlang/source/tlang/compiler/parsing/exceptions.d

34 lines
657 B
D
Raw Normal View History

2021-06-08 09:37:38 +01:00
module compiler.parsing.exceptions;
2021-06-08 09:45:14 +01:00
import compiler.parsing.core;
import compiler.lexer;
import misc.exceptions;
import compiler.symbols.check;
import compiler.symbols.data;
import compiler.lexer : Token;
2021-06-08 09:37:38 +01:00
public class ParserException : TError
{
private Parser parser;
2021-06-08 09:37:38 +01:00
this(Parser parser)
{
2021-06-08 09:45:14 +01:00
super("");
this.parser = parser;
2021-06-08 09:37:38 +01:00
}
2021-06-08 09:37:38 +01:00
}
2021-06-08 09:37:43 +01:00
public final class SyntaxError : ParserException
{
private SymbolType expected;
private SymbolType provided;
this(Parser parser, SymbolType expected, SymbolType provided)
2021-06-08 09:37:43 +01:00
{
super(parser);
2021-06-08 09:37:43 +01:00
this.expected = expected;
this.provided = provided;
}
}