Skip to content

Commit

Permalink
tidb: Check reduce/reduce conflicts in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
shenli committed Nov 15, 2015
1 parent 9620eb0 commit 31d0dbd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ build:
install:
$(GO) install ./...

TEMP_FILE = temp_parser_file

parser:
go get github.com/qiuyesuifeng/goyacc
go get github.com/qiuyesuifeng/golex
a=`mktemp temp.XXXXXX`; \
goyacc -o /dev/null -xegen $$a parser/parser.y; \
goyacc -o parser/parser.go -xe $$a parser/parser.y 2>&1 | grep "shift/reduce" | awk '{print} END {if (NR > 0) {print "Find conflict in parser.y. Please check y.output for more information."; exit 1;}}'; \
rm -f $$a; \
goyacc -o /dev/null -xegen $(TEMP_FILE) parser/parser.y; \
goyacc -o parser/parser.go -xe $(TEMP_FILE) parser/parser.y 2>&1 | egrep "(shift|reduce)/reduce" | awk '{print} END {if (NR > 0) {print "Find conflict in parser.y. Please check y.output for more information."; system("rm -f $(TEMP_FILE)"); exit 1;}}';
rm -f $(TEMP_FILE); \
rm -f y.output

@if [ $(ARCH) = $(LINUX) ]; \
Expand Down

0 comments on commit 31d0dbd

Please sign in to comment.