diff options
author | Russ Cox <rsc@golang.org> | 2009-02-18 10:07:46 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-02-18 10:07:46 -0800 |
commit | f65cb611911b49d4a8bbf7741857574fe6d5f16c (patch) | |
tree | 142b19182e464bc8811c91b8e93f4994ddb25d6f /src | |
parent | f115703ed0f405e0683005aa8a6cecdcb23a3cd2 (diff) | |
download | golang-f65cb611911b49d4a8bbf7741857574fe6d5f16c.tar.gz |
allow parens to disambiguate types.
examples:
chan <- (chan int)
chan (<- chan int)
(map[string]func())("a": main)
R=ken
OCL=25151
CL=25151
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/gc/go.y | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y index d68576428..320c9c684 100644 --- a/src/cmd/gc/go.y +++ b/src/cmd/gc/go.y @@ -1004,6 +1004,10 @@ convtype: $$->type = $5; } | structtype +| '(' type ')' + { + $$ = $2; + } /* * to avoid parsing conflicts, type is split into @@ -1031,6 +1035,10 @@ Btype: | Bchantype | Bfntype | Bothertype +| '(' type ')' + { + $$ = $2; + } non_name_type: chantype @@ -1052,6 +1060,10 @@ Bnon_chan_type: nametype | Bfntype | Bothertype +| '(' Btype ')' + { + $$ = $2; + } Anon_fn_type: Achantype @@ -1062,7 +1074,6 @@ Bnon_fn_type: | Bchantype | Bothertype - nametype: LATYPE { |