Commit 431c2328 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile/internal/gc: address TODO (better comment)

For #13243.

Change-Id: I544a8c44971fad126103157575e983ab528309bf
Reviewed-on: https://go-review.googlesource.com/17044Reviewed-by: default avatarChris Manghane <cmang@golang.org>
parent fe762b64
...@@ -1482,6 +1482,11 @@ func (p *parser) operand(keep_parens bool) *Node { ...@@ -1482,6 +1482,11 @@ func (p *parser) operand(keep_parens bool) *Node {
p.advance() p.advance()
return nil return nil
} }
// Syntactically, composite literals are operands. Because a complit
// type may be a qualified identifier which is handled by pexpr
// (together with selector expressions), complits are parsed there
// as well (operand is only called from pexpr).
} }
// go.y:pexpr, pexpr_no_paren // go.y:pexpr, pexpr_no_paren
...@@ -1581,13 +1586,9 @@ loop: ...@@ -1581,13 +1586,9 @@ loop:
x.Isddd = ddd x.Isddd = ddd
case '{': case '{':
// TODO(gri) should this (complit acceptance) be in operand? // operand may have returned a parenthesized complit
// accept ()'s around the complit type but complain if we have a complit // type; accept it but complain if we have a complit
// (issue 13243) t := unparen(x)
t := x
for t.Op == OPAREN {
t = t.Left
}
// determine if '{' belongs to a complit or a compound_stmt // determine if '{' belongs to a complit or a compound_stmt
complit_ok := false complit_ok := false
switch t.Op { switch t.Op {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment