diff options
| author | Robert Griesemer <gri@golang.org> | 2009-03-27 13:43:28 -0700 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2009-03-27 13:43:28 -0700 |
| commit | c5c577c1ff19f7398c9c97755d6cfdbe73df53b6 (patch) | |
| tree | 17c5b31ece4fb7706e3f26b07558c5f5db9130d6 | |
| parent | 5019a8db7fc5de588ae2070be8f7f3a794e9b610 (diff) | |
| download | go-c5c577c1ff19f7398c9c97755d6cfdbe73df53b6.tar.xz | |
- minor tweak to composite literal production:
renamed PairExpr -> KeyValueExpr and PairExprList -> KeyValueList
(to match corresponding nodes in AST per rsc' suggestion)
- added a couple of TODOs
R=r,rsc
DELTA=10 (2 added, 0 deleted, 8 changed)
OCL=26837
CL=26840
| -rw-r--r-- | doc/go_spec.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html index ad98b8355a..e90f605605 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -25,7 +25,9 @@ Todo's: [ ] fix "else" part of if statement [ ] cleanup: 6g allows: interface { f F } where F is a function type. fine, but then we should also allow: func f F {}, where F is a function type. - +[ ] decide if and what to write about evaluation order of tuple assignments +[ ] decide if and what to write about evaluation order of composite literal + elements (single expressions, (key:value) pairs) Wish list: [ ] enum facility (enum symbols that are not mixable with ints) or some other @@ -1885,15 +1887,15 @@ Composite literals construct values for structs, arrays, slices, and maps and create a new value each time they are evaluated. They consist of the type of the value followed by a brace-bound list of expressions, -or a list of expression pairs for map literals. +or a list of key-value pairs for map literals. </p> <pre class="grammar"> -CompositeLit = LiteralType "{" [ ( ExpressionList | ExprPairList ) [ "," ] ] "}" . +CompositeLit = LiteralType "{" [ ( ExpressionList | KeyValueList ) [ "," ] ] "}" . LiteralType = StructType | ArrayType | "[" "..." "]" ElementType | SliceType | MapType | TypeName . -ExprPairList = ExprPair { "," ExprPair } . -ExprPair = Expression ":" Expression . +KeyValueList = KeyValueExpr { "," KeyValueExpr } . +KeyValueExpr = Expression ":" Expression . </pre> <p> |
