mirror of
https://github.com/golang/go
synced 2024-11-22 00:34:40 -07:00
fix for incorrect composite literal grammar
(issue found by ken) R=go-dev, rsc http://go/go-review/1025030
This commit is contained in:
parent
40621d5c0d
commit
fb5fce5532
@ -1890,8 +1890,9 @@ LiteralType = StructType | ArrayType | "[" "..." "]" ElementType |
|
|||||||
SliceType | MapType | TypeName | "(" LiteralType ")" .
|
SliceType | MapType | TypeName | "(" LiteralType ")" .
|
||||||
ElementList = Element { "," Element } [ "," ] .
|
ElementList = Element { "," Element } [ "," ] .
|
||||||
Element = [ Key ":" ] Value .
|
Element = [ Key ":" ] Value .
|
||||||
Key = FieldName | Index .
|
Key = FieldName | ElementIndex .
|
||||||
FieldName = identifier .
|
FieldName = identifier .
|
||||||
|
ElementIndex = Expression .
|
||||||
Value = Expression .
|
Value = Expression .
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user