Parser panic information is now more detailed

This commit is contained in:
Sasha Koshka 2024-02-07 13:01:25 -05:00
parent a80b6ad74e
commit 239dcfe5a0

View File

@ -134,7 +134,13 @@ func (this *Parser) next () error {
}
func (this *Parser) bug () string {
return fmt.Sprintln("bug detected in the compiler! token:", this.token.Kind)
return fmt.Sprintln (
"Bug detected in the compiler!\n" +
"The parser has taken an unexpected control path.",
"This could be due to an un-implemented feature.\n" +
"Please submit a report with this info and stack trace to:",
"https://git.tebibyte.media/sashakoshka/fspl/issues\n" +
"The token being parsed was:", this.token.Kind)
}
func (this *Parser) kind () lexer.TokenKind {