mirror of
https://github.com/golang/go
synced 2024-11-19 03:04:42 -07:00
cmd/yacc/testdata/expr: fix handling of negative numbers
Fixes #10129. Change-Id: I9f56c483726f14b6c1909740549de236d5bf9cfb Reviewed-on: https://go-review.googlesource.com/7340 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
e498181942
commit
b2843becab
10
src/cmd/yacc/testdata/expr/expr.y
vendored
10
src/cmd/yacc/testdata/expr/expr.y
vendored
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user