Parse "x + 1".

This commit is contained in:
Nigel Tao committed 2017-05-04 14:26:12 +10:00
1 parent c86ff2fcc3
commit 2d6ca0777a
1 file changed
+7
+7
View File
@@ -319,6 +319,13 @@ func (p *parser) parseOperand() (*a.Node, error) {
ID0: x,
RHS: rhs,
}, nil
case x.IsLiteral():
p.src = p.src[1:]
return &a.Node{
Kind: a.KExpr,
ID1: x,
}, nil
}
id, err := p.parseIdent()