Add pkg to ast Expr nodes

This commit is contained in:
Nigel Tao committed 2017-12-29 13:28:31 +11:00
1 parent 8b4ba30a36
commit 139bcfa7f1
5 files changed
+25 -7

No files matched your search

+1
View File
@@ -932,6 +932,7 @@ func (p *parser) parseOperand() (*a.Expr, error) {
keyword := x
p.src = p.src[1:]
message := p.peek1()
// TODO: parse the "pkg" in `error pkg."foo"`.
if !message.IsStrLiteral() {
got := p.tm.ByID(message)
return nil, fmt.Errorf(`parse: expected string literal, got %q at %s:%d`, got, p.filename, p.line())