Change status "?foo" to just "?foo"

This commit is contained in:
Nigel Tao committed 2018-11-24 12:36:42 +11:00
1 parent 5f9d007b1c
commit 875362ea07
14 files changed
+136 -152

No files matched your search

-12
View File
@@ -1008,18 +1008,6 @@ func (p *parser) parseOperand() (*a.Expr, error) {
}
p.src = p.src[1:]
return expr, nil
case t.IDStatus:
p.src = p.src[1:]
message := p.peek1()
// TODO: parse the "pkg" in `error pkg."foo"`.
statusPkg := t.ID(0)
if !message.IsStrLiteral(p.tm) {
got := p.tm.ByID(message)
return nil, fmt.Errorf(`parse: expected string literal, got %q at %s:%d`, got, p.filename, p.line())
}
p.src = p.src[1:]
return a.NewExpr(0, t.IDStatus, statusPkg, message, nil, nil, nil, nil), nil
}
}