Преглед изворни кода

replace antlr module (#672)

* replace antlr module

* refactor version of antlr
anqiansong пре 3 година
родитељ
комит
df5ae9507f

+ 1 - 2
go.mod

@@ -6,7 +6,6 @@ require (
 	github.com/ClickHouse/clickhouse-go v1.4.3
 	github.com/DATA-DOG/go-sqlmock v1.4.1
 	github.com/alicebob/miniredis/v2 v2.14.1
-	github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2
 	github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
 	github.com/dgrijalva/jwt-go v3.2.0+incompatible
 	github.com/emicklei/proto v1.9.0
@@ -44,6 +43,7 @@ require (
 	github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 // indirect
 	github.com/urfave/cli v1.22.5
 	github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
+	github.com/zeromicro/antlr v0.0.1 // indirect
 	go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698
 	go.uber.org/automaxprocs v1.3.0
 	golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
@@ -61,4 +61,3 @@ require (
 	honnef.co/go/tools v0.0.1-2020.1.4 // indirect
 	sigs.k8s.io/yaml v1.2.0 // indirect
 )
-replace github.com/antlr/antlr4/runtime/Go/antlr => github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2

+ 4 - 0
go.sum

@@ -276,6 +276,10 @@ github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeI
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0=
 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
+github.com/zeromicro/antlr v0.0.0-20210508120604-8d7a7786f5c4 h1:wt86gT5lsN+xWmij6lFCrDIqoxeOnqM2MxiO7cNm+Lo=
+github.com/zeromicro/antlr v0.0.0-20210508120604-8d7a7786f5c4/go.mod h1:nfpjEwFR6Q4xGDJMcZnCL9tEfQRgszMwu3rDz2Z+p5M=
+github.com/zeromicro/antlr v0.0.1 h1:CQpIn/dc0pUjgGQ81y98s/NGOm2Hfru2NNio2I9mQgk=
+github.com/zeromicro/antlr v0.0.1/go.mod h1:nfpjEwFR6Q4xGDJMcZnCL9tEfQRgszMwu3rDz2Z+p5M=
 go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
 go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
 go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698 h1:jWtjCJX1qxhHISBMLRztWwR+EXkI7MJAF2HjHAE/x/I=

+ 1 - 1
tools/goctl/api/parser/g4/ast/apiparser.go

@@ -6,9 +6,9 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/antlr/antlr4/runtime/Go/antlr"
 	"github.com/tal-tech/go-zero/tools/goctl/api/parser/g4/gen/api"
 	"github.com/tal-tech/go-zero/tools/goctl/util/console"
+	"github.com/zeromicro/antlr"
 )
 
 type (

+ 1 - 1
tools/goctl/api/parser/g4/ast/ast.go

@@ -5,9 +5,9 @@ import (
 	"sort"
 	"strings"
 
-	"github.com/antlr/antlr4/runtime/Go/antlr"
 	"github.com/tal-tech/go-zero/tools/goctl/api/parser/g4/gen/api"
 	"github.com/tal-tech/go-zero/tools/goctl/util/console"
+	"github.com/zeromicro/antlr"
 )
 
 type (

+ 1 - 1
tools/goctl/api/parser/g4/gen/api/apiparser_base_visitor.go

@@ -1,7 +1,7 @@
 // Code generated from tools/goctl/api/parser/g4/ApiParser.g4 by ANTLR 4.9. DO NOT EDIT.
 
 package api // ApiParser
-import "github.com/antlr/antlr4/runtime/Go/antlr"
+import "github.com/zeromicro/antlr"
 
 type BaseApiParserVisitor struct {
 	*antlr.BaseParseTreeVisitor

+ 1 - 1
tools/goctl/api/parser/g4/gen/api/apiparser_lexer.go

@@ -6,7 +6,7 @@ import (
 	"fmt"
 	"unicode"
 
-	"github.com/antlr/antlr4/runtime/Go/antlr"
+	"github.com/zeromicro/antlr"
 )
 
 // Suppress unused import error

+ 1 - 1
tools/goctl/api/parser/g4/gen/api/apiparser_parser.go

@@ -6,7 +6,7 @@ import (
 	"reflect"
 	"strconv"
 
-	"github.com/antlr/antlr4/runtime/Go/antlr"
+	"github.com/zeromicro/antlr"
 )
 
 // Suppress unused import errors

+ 1 - 1
tools/goctl/api/parser/g4/gen/api/apiparser_visitor.go

@@ -1,7 +1,7 @@
 // Code generated from tools/goctl/api/parser/g4/ApiParser.g4 by ANTLR 4.9. DO NOT EDIT.
 
 package api // ApiParser
-import "github.com/antlr/antlr4/runtime/Go/antlr"
+import "github.com/zeromicro/antlr"
 
 // A complete Visitor for a parse tree produced by ApiParserParser.
 type ApiParserVisitor interface {

+ 1 - 1
tools/goctl/api/parser/g4/gen/api/baseparser.go

@@ -7,7 +7,7 @@ import (
 	"strings"
 	"unicode"
 
-	"github.com/antlr/antlr4/runtime/Go/antlr"
+	"github.com/zeromicro/antlr"
 )
 
 const (