]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/gc, cmd/yacc: implement "expecting" syntax error messages
authorMatthew Dempsky <mdempsky@google.com>
Fri, 3 Apr 2015 04:51:46 +0000 (21:51 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 7 Apr 2015 00:18:02 +0000 (00:18 +0000)
commite7d9f81645dcff1878ac71371d8aee5b46e7b04b
tree1a0a0a5a2873b39e3f45a8a3601fb17b07fc3f31
parentee54d5710117aa409e1608c7c97cf7d18ebfe3b2
cmd/internal/gc, cmd/yacc: implement "expecting" syntax error messages

Bison includes suggestions about what tokens are expected in the
current state when there's only four or fewer of them.  For example:

  syntax error: unexpected literal 2.01, expecting semicolon or newline or }

This CL adds the same functionality to cmd/yacc, which fully restores
the previous error message behavior from Go 1.4.

Updates #9968.

Change-Id: I2c1a1677c6d829a829d812c05e8813aa8829d09c
Reviewed-on: https://go-review.googlesource.com/8494
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/internal/gc/subr.go
src/cmd/internal/gc/y.go
src/cmd/yacc/yacc.go