Add colons to const syntax

This commit is contained in:
Nigel Tao committed 2020-04-14 14:57:30 +10:00
1 parent 80071730a3
commit 532e18c4a5
16 files changed
+119 -99

No files matched your search

+6
View File
@@ -140,6 +140,12 @@ func (p *parser) parseTopLevelDecl() (*a.Node, error) {
}
// TODO: check AllowDoubleUnderscoreNames?
if x := p.peek1(); x != t.IDColon {
got := p.tm.ByID(x)
return nil, fmt.Errorf(`parse: expected ":", got %q at %s:%d`, got, p.filename, p.line())
}
p.src = p.src[1:]
typ, err := p.parseTypeExpr()
if err != nil {
return nil, err