Merge pull request #40 from tapichu/master

Use *lexer.describe in parse error message
This commit is contained in:
alandonovan
2020-03-23 11:58:55 -04:00
committed by GitHub

View File

@@ -130,7 +130,7 @@ func parsePrimary(lex *lexer) Expr {
lex.next() // consume ','
}
if lex.token != ')' {
msg := fmt.Sprintf("got %q, want ')'", lex.token)
msg := fmt.Sprintf("got %s, want ')'", lex.describe())
panic(lexPanic(msg))
}
}