diff options
Diffstat (limited to 'src/cmd/godoc/spec.go')
-rw-r--r-- | src/cmd/godoc/spec.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/godoc/spec.go b/src/cmd/godoc/spec.go index d863ca0d84..444e36e086 100644 --- a/src/cmd/godoc/spec.go +++ b/src/cmd/godoc/spec.go @@ -129,6 +129,9 @@ func (p *ebnfParser) parseTerm() bool { func (p *ebnfParser) parseSequence() { + if !p.parseTerm() { + p.errorExpected(p.pos, "term") + } for p.parseTerm() { } } @@ -148,7 +151,9 @@ func (p *ebnfParser) parseExpression() { func (p *ebnfParser) parseProduction() { p.parseIdentifier(true) p.expect(token.ASSIGN) - p.parseExpression() + if p.tok != token.PERIOD { + p.parseExpression() + } p.expect(token.PERIOD) } |