Skip to content

Commit

Permalink
Merge pull request #40 from tapichu/master
Browse files Browse the repository at this point in the history
Use *lexer.describe in parse error message
  • Loading branch information
adonovan committed Mar 23, 2020
2 parents 1e9cbf3 + 0a23d45 commit 65c318d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ch7/eval/parse.go
Expand Up @@ -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))
}
}
Expand Down

0 comments on commit 65c318d

Please sign in to comment.