]> Cypherpunks repositories - gostls13.git/commitdiff
fix for incorrect composite literal grammar
authorRobert Griesemer <gri@golang.org>
Mon, 9 Nov 2009 20:35:56 +0000 (12:35 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 9 Nov 2009 20:35:56 +0000 (12:35 -0800)
(issue found by ken)

R=go-dev, rsc
http://go/go-review/1025030

doc/go_spec.html

index 5860eec7f0c6b71b8d77f0e3dffd0639bf03645a..376046b77da260e146d88bebd743b58f90204930 100644 (file)
@@ -1890,8 +1890,9 @@ LiteralType   = StructType | ArrayType | "[" "..." "]" ElementType |
                 SliceType | MapType | TypeName | "(" LiteralType ")" .
 ElementList   = Element { "," Element } [ "," ] .
 Element       = [ Key ":" ] Value .
-Key           = FieldName | Index .
+Key           = FieldName | ElementIndex .
 FieldName     = identifier .
+ElementIndex  = Expression .
 Value         = Expression .
 </pre>