]> Cypherpunks repositories - gostls13.git/commit
go/parser: fix (pathological) corner case
authorRobert Griesemer <gri@golang.org>
Mon, 8 Sep 2014 21:54:00 +0000 (14:54 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 8 Sep 2014 21:54:00 +0000 (14:54 -0700)
commitec96795ba20209263a0bbb17a073a9c028e74437
tree4177c8540ea8a595ba9fa73ee05ff2cb1bd683d2
parent857d55a3f9cfc8ccc8aef24571417ae4ecabbcc9
go/parser: fix (pathological) corner case

Inside a control clause (if ... {}), composite
literals starting with a type name must be parenthesized.
A composite literal used in the array length expression
of an array composite literal is already parenthesized.
Not a valid program, but syntactically is should
be accepted.

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/142760043
src/go/parser/parser.go
src/go/parser/short_test.go