Commit b2843bec authored by Matthew Dempsky's avatar Matthew Dempsky Committed by Ian Lance Taylor

cmd/yacc/testdata/expr: fix handling of negative numbers

Fixes #10129.

Change-Id: I9f56c483726f14b6c1909740549de236d5bf9cfb
Reviewed-on: https://go-review.googlesource.com/7340Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent e4981819
......@@ -56,29 +56,29 @@ expr:
}
| '-' expr
{
$$.Neg($2)
$$ = $2.Neg($2)
}
expr1:
expr2
| expr1 '+' expr2
{
$$.Add($1, $3)
$$ = $1.Add($1, $3)
}
| expr1 '-' expr2
{
$$.Sub($1, $3)
$$ = $1.Sub($1, $3)
}
expr2:
expr3
| expr2 '*' expr3
{
$$.Mul($1, $3)
$$ = $1.Mul($1, $3)
}
| expr2 '/' expr3
{
$$.Quo($1, $3)
$$ = $1.Quo($1, $3)
}
expr3:
......
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