SyntaxError
- The generated message now uses `report(string, Token)` to generate its `msg`
This commit is contained in:
parent
bfa1295c06
commit
adb6b203d1
|
@ -6,6 +6,7 @@ import tlang.compiler.symbols.check;
|
|||
import tlang.compiler.symbols.data;
|
||||
import tlang.compiler.lexer.core.tokens : Token;
|
||||
import std.conv : to;
|
||||
import tlang.compiler.reporting : LineInfo, report;
|
||||
|
||||
public class ParserException : TError
|
||||
{
|
||||
|
@ -38,6 +39,10 @@ public final class SyntaxError : ParserException
|
|||
|
||||
super(parser);
|
||||
|
||||
msg = "Syntax error: Expected "~to!(string)(expected)~" but got "~to!(string)(provided)~", see "~providedToken.toString();
|
||||
msg = report
|
||||
(
|
||||
"Syntax error: Expected "~to!(string)(expected)~" but got "~to!(string)(provided)~", see "~providedToken.toString(),
|
||||
providedToken
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue