1
0
mirror of https://github.com/golang/go synced 2024-11-13 19:10:22 -07:00

parse expression statements beginning with

arithmetic unary operators + - ^

R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=34338
CL=34350
This commit is contained in:
Russ Cox 2009-09-03 16:37:02 -07:00
parent dcb1c5f5d4
commit 55ba20ec2d

View File

@ -1631,7 +1631,7 @@ func (p *parser) parseStmt() ast.Stmt {
// tokens that may start a top-level expression
token.IDENT, token.INT, token.FLOAT, token.CHAR, token.STRING, token.FUNC, token.LPAREN, // operand
token.LBRACK, token.STRUCT, // composite type
token.MUL, token.AND, token.ARROW: // unary operators
token.MUL, token.AND, token.ARROW, token.ADD, token.SUB, token.XOR: // unary operators
return p.parseSimpleStmt(true);
case token.GO:
return p.parseGoStmt();