]> Cypherpunks repositories - gostls13.git/commitdiff
parse expression statements beginning with
authorRuss Cox <rsc@golang.org>
Thu, 3 Sep 2009 23:37:02 +0000 (16:37 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 3 Sep 2009 23:37:02 +0000 (16:37 -0700)
arithmetic unary operators + - ^

R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=34338
CL=34350

src/pkg/go/parser/parser.go

index 9f8be910b236c3c60c3d261f6573886f71d18dce..f9d38a4b0c9b51d3f959b38b52cfeaab5ec9f6f2 100644 (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();