mirror of https://github.com/golang/go.git
cmd/yacc: expr example support windows
1. expr append executable extension. 2. support '\r' character. Fixes #6851. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/35330043
This commit is contained in:
parent
0eaabf6452
commit
0b26ba8af3
|
|
@ -2,9 +2,11 @@
|
|||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
expr: yacc.go expr.y
|
||||
TARG=expr$(shell go env GOEXE)
|
||||
|
||||
$(TARG): yacc.go expr.y
|
||||
go run yacc.go -p expr expr.y
|
||||
go build -o expr y.go
|
||||
go build -o $(TARG) y.go
|
||||
|
||||
clean:
|
||||
rm -f y.go y.output expr
|
||||
rm -f y.go y.output $(TARG)
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ func (x *exprLex) Lex(yylval *exprSymType) int {
|
|||
case '÷':
|
||||
return '/'
|
||||
|
||||
case ' ', '\t', '\n':
|
||||
case ' ', '\t', '\n', '\r':
|
||||
default:
|
||||
log.Printf("unrecognized character %q", c)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue