auxten / postgresql-parser

Pure Golang PostgreSQL (SQL:2011, SQL:2008, SQL:2003, SQL:1999, and SQL-92 Standard) Parser
Apache License 2.0
273 stars 50 forks source link

run make all get error no /pkg/cmd/prereqs #2

Closed finch039 closed 3 years ago

finch039 commented 3 years ago

(echo "// Code generated by goyacc. DO NOT EDIT."; \ echo "// GENERATED FILE DO NOT EDIT"; \ cat pkg/sql/parser/gen/sql.go.tmp | \ sed -E 's/^const ([A-Z][_A-Z0-9]) =.$/const \1 = lex.\1/g') > pkg/sql/parser/sql.go.tmp || rm pkg/sql/parser/sql.go.tmp mv -f pkg/sql/parser/sql.go.tmp pkg/sql/parser/sql.go goimports -w pkg/sql/parser/sql.go (echo "// Code generated by make. DO NOT EDIT."; \ echo "// GENERATED FILE DO NOT EDIT"; \ echo; \ echo "package lex"; \ echo; \ grep '^const [A-Z][_A-Z0-9]* ' pkg/sql/parser/gen/sql.go.tmp) > pkg/sql/lex/tokens.go.tmp || rm pkg/sql/lex/tokens.go.tmp mv -f pkg/sql/lex/tokens.go.tmp pkg/sql/lex/tokens.go go install -v ./pkg/cmd/prereqs can't load package: package ./pkg/cmd/prereqs: cannot find package "." in:

auxten commented 3 years ago

Don't run make, just import it like the example.

auxten commented 3 years ago

I also added another example and a handy AstWalker. See walk.go