chore: change interface{} to any (#2818)
* chore: change interface{} to any
* chore: update goctl version to 1.5.0
* chore: update goctl deps
This commit is contained in:
@@ -29,7 +29,7 @@ type Api struct {
|
||||
}
|
||||
|
||||
// VisitApi implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitApi(ctx *api.ApiContext) interface{} {
|
||||
func (v *ApiVisitor) VisitApi(ctx *api.ApiContext) any {
|
||||
var final Api
|
||||
final.importM = map[string]PlaceHolder{}
|
||||
final.typeM = map[string]PlaceHolder{}
|
||||
@@ -176,7 +176,7 @@ func (v *ApiVisitor) acceptSyntax(root, final *Api) {
|
||||
}
|
||||
|
||||
// VisitSpec implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitSpec(ctx *api.SpecContext) interface{} {
|
||||
func (v *ApiVisitor) VisitSpec(ctx *api.SpecContext) any {
|
||||
var root Api
|
||||
if ctx.SyntaxLit() != nil {
|
||||
root.Syntax = ctx.SyntaxLit().Accept(v).(*SyntaxExpr)
|
||||
@@ -209,7 +209,7 @@ func (a *Api) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two Api are equal
|
||||
func (a *Api) Equal(v interface{}) bool {
|
||||
func (a *Api) Equal(v any) bool {
|
||||
if v == nil || a == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func NewParser(options ...ParserOption) *Parser {
|
||||
|
||||
// Accept can parse any terminalNode of api tree by fn.
|
||||
// -- for debug
|
||||
func (p *Parser) Accept(fn func(p *api.ApiParserParser, visitor *ApiVisitor) interface{}, content string) (v interface{}, err error) {
|
||||
func (p *Parser) Accept(fn func(p *api.ApiParserParser, visitor *ApiVisitor) any, content string) (v any, err error) {
|
||||
defer func() {
|
||||
p := recover()
|
||||
if p != nil {
|
||||
@@ -507,7 +507,7 @@ func (p *Parser) readContent(filename string) (string, error) {
|
||||
}
|
||||
|
||||
// SyntaxError accepts errors and panic it
|
||||
func (p *Parser) SyntaxError(_ antlr.Recognizer, _ interface{}, line, column int, msg string, _ antlr.RecognitionException) {
|
||||
func (p *Parser) SyntaxError(_ antlr.Recognizer, _ any, line, column int, msg string, _ antlr.RecognitionException) {
|
||||
str := fmt.Sprintf(`%s line %d:%d %s`, p.linePrefix, line, column, msg)
|
||||
if p.debug {
|
||||
p.log.Error(str)
|
||||
|
||||
@@ -36,7 +36,7 @@ type (
|
||||
Doc() []Expr
|
||||
Comment() Expr
|
||||
Format() error
|
||||
Equal(v interface{}) bool
|
||||
Equal(v any) bool
|
||||
}
|
||||
|
||||
// Expr describes ast expression
|
||||
|
||||
@@ -13,7 +13,7 @@ type ImportExpr struct {
|
||||
}
|
||||
|
||||
// VisitImportSpec implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitImportSpec(ctx *api.ImportSpecContext) interface{} {
|
||||
func (v *ApiVisitor) VisitImportSpec(ctx *api.ImportSpecContext) any {
|
||||
var list []*ImportExpr
|
||||
if ctx.ImportLit() != nil {
|
||||
lits := ctx.ImportLit().Accept(v).([]*ImportExpr)
|
||||
@@ -28,7 +28,7 @@ func (v *ApiVisitor) VisitImportSpec(ctx *api.ImportSpecContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitImportLit implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitImportLit(ctx *api.ImportLitContext) interface{} {
|
||||
func (v *ApiVisitor) VisitImportLit(ctx *api.ImportLitContext) any {
|
||||
importToken := v.newExprWithToken(ctx.GetImportToken())
|
||||
valueExpr := ctx.ImportValue().Accept(v).(Expr)
|
||||
return []*ImportExpr{
|
||||
@@ -42,7 +42,7 @@ func (v *ApiVisitor) VisitImportLit(ctx *api.ImportLitContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitImportBlock implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitImportBlock(ctx *api.ImportBlockContext) interface{} {
|
||||
func (v *ApiVisitor) VisitImportBlock(ctx *api.ImportBlockContext) any {
|
||||
importToken := v.newExprWithToken(ctx.GetImportToken())
|
||||
values := ctx.AllImportBlockValue()
|
||||
var list []*ImportExpr
|
||||
@@ -57,7 +57,7 @@ func (v *ApiVisitor) VisitImportBlock(ctx *api.ImportBlockContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitImportBlockValue implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitImportBlockValue(ctx *api.ImportBlockValueContext) interface{} {
|
||||
func (v *ApiVisitor) VisitImportBlockValue(ctx *api.ImportBlockValueContext) any {
|
||||
value := ctx.ImportValue().Accept(v).(Expr)
|
||||
return &ImportExpr{
|
||||
Value: value,
|
||||
@@ -67,7 +67,7 @@ func (v *ApiVisitor) VisitImportBlockValue(ctx *api.ImportBlockValueContext) int
|
||||
}
|
||||
|
||||
// VisitImportValue implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitImportValue(ctx *api.ImportValueContext) interface{} {
|
||||
func (v *ApiVisitor) VisitImportValue(ctx *api.ImportValueContext) any {
|
||||
return v.newExprWithTerminalNode(ctx.STRING())
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ func (i *ImportExpr) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two ImportExpr are equal
|
||||
func (i *ImportExpr) Equal(v interface{}) bool {
|
||||
func (i *ImportExpr) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ type InfoExpr struct {
|
||||
}
|
||||
|
||||
// VisitInfoSpec implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitInfoSpec(ctx *api.InfoSpecContext) interface{} {
|
||||
func (v *ApiVisitor) VisitInfoSpec(ctx *api.InfoSpecContext) any {
|
||||
var expr InfoExpr
|
||||
expr.Info = v.newExprWithToken(ctx.GetInfoToken())
|
||||
expr.Lp = v.newExprWithToken(ctx.GetLp())
|
||||
@@ -38,7 +38,7 @@ func (i *InfoExpr) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two InfoExpr are equal
|
||||
func (i *InfoExpr) Equal(v interface{}) bool {
|
||||
func (i *InfoExpr) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type KvExpr struct {
|
||||
}
|
||||
|
||||
// VisitKvLit implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitKvLit(ctx *api.KvLitContext) interface{} {
|
||||
func (v *ApiVisitor) VisitKvLit(ctx *api.KvLitContext) any {
|
||||
var kvExpr KvExpr
|
||||
kvExpr.Key = v.newExprWithToken(ctx.GetKey())
|
||||
commentExpr := v.getComment(ctx)
|
||||
@@ -57,7 +57,7 @@ func (k *KvExpr) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two KvExpr are equal
|
||||
func (k *KvExpr) Equal(v interface{}) bool {
|
||||
func (k *KvExpr) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ type Body struct {
|
||||
}
|
||||
|
||||
// VisitServiceSpec implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitServiceSpec(ctx *api.ServiceSpecContext) interface{} {
|
||||
func (v *ApiVisitor) VisitServiceSpec(ctx *api.ServiceSpecContext) any {
|
||||
var serviceSpec Service
|
||||
if ctx.AtServer() != nil {
|
||||
serviceSpec.AtServer = ctx.AtServer().Accept(v).(*AtServer)
|
||||
@@ -89,7 +89,7 @@ func (v *ApiVisitor) VisitServiceSpec(ctx *api.ServiceSpecContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitAtServer implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitAtServer(ctx *api.AtServerContext) interface{} {
|
||||
func (v *ApiVisitor) VisitAtServer(ctx *api.AtServerContext) any {
|
||||
var atServer AtServer
|
||||
atServer.AtServerToken = v.newExprWithTerminalNode(ctx.ATSERVER())
|
||||
atServer.Lp = v.newExprWithToken(ctx.GetLp())
|
||||
@@ -103,7 +103,7 @@ func (v *ApiVisitor) VisitAtServer(ctx *api.AtServerContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitServiceApi implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitServiceApi(ctx *api.ServiceApiContext) interface{} {
|
||||
func (v *ApiVisitor) VisitServiceApi(ctx *api.ServiceApiContext) any {
|
||||
var serviceApi ServiceApi
|
||||
serviceApi.ServiceToken = v.newExprWithToken(ctx.GetServiceToken())
|
||||
serviceName := ctx.ServiceName()
|
||||
@@ -119,7 +119,7 @@ func (v *ApiVisitor) VisitServiceApi(ctx *api.ServiceApiContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitServiceRoute implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitServiceRoute(ctx *api.ServiceRouteContext) interface{} {
|
||||
func (v *ApiVisitor) VisitServiceRoute(ctx *api.ServiceRouteContext) any {
|
||||
var serviceRoute ServiceRoute
|
||||
if ctx.AtDoc() != nil {
|
||||
serviceRoute.AtDoc = ctx.AtDoc().Accept(v).(*AtDoc)
|
||||
@@ -136,7 +136,7 @@ func (v *ApiVisitor) VisitServiceRoute(ctx *api.ServiceRouteContext) interface{}
|
||||
}
|
||||
|
||||
// VisitAtDoc implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitAtDoc(ctx *api.AtDocContext) interface{} {
|
||||
func (v *ApiVisitor) VisitAtDoc(ctx *api.AtDocContext) any {
|
||||
var atDoc AtDoc
|
||||
atDoc.AtDocToken = v.newExprWithTerminalNode(ctx.ATDOC())
|
||||
|
||||
@@ -166,7 +166,7 @@ func (v *ApiVisitor) VisitAtDoc(ctx *api.AtDocContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitAtHandler implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitAtHandler(ctx *api.AtHandlerContext) interface{} {
|
||||
func (v *ApiVisitor) VisitAtHandler(ctx *api.AtHandlerContext) any {
|
||||
var atHandler AtHandler
|
||||
astHandlerExpr := v.newExprWithTerminalNode(ctx.ATHANDLER())
|
||||
atHandler.AtHandlerToken = astHandlerExpr
|
||||
@@ -177,7 +177,7 @@ func (v *ApiVisitor) VisitAtHandler(ctx *api.AtHandlerContext) interface{} {
|
||||
}
|
||||
|
||||
// serVisitRoute implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitRoute(ctx *api.RouteContext) interface{} {
|
||||
func (v *ApiVisitor) VisitRoute(ctx *api.RouteContext) any {
|
||||
var route Route
|
||||
path := ctx.Path()
|
||||
methodExpr := v.newExprWithToken(ctx.GetHttpMethod())
|
||||
@@ -207,7 +207,7 @@ func (v *ApiVisitor) VisitRoute(ctx *api.RouteContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitBody implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitBody(ctx *api.BodyContext) interface{} {
|
||||
func (v *ApiVisitor) VisitBody(ctx *api.BodyContext) any {
|
||||
if ctx.ID() == nil {
|
||||
if v.debug {
|
||||
msg := fmt.Sprintf(
|
||||
@@ -233,7 +233,7 @@ func (v *ApiVisitor) VisitBody(ctx *api.BodyContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitReplybody implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) interface{} {
|
||||
func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) any {
|
||||
if ctx.DataType() == nil {
|
||||
if v.debug {
|
||||
msg := fmt.Sprintf(
|
||||
@@ -294,7 +294,7 @@ func (b *Body) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two Body are equal
|
||||
func (b *Body) Equal(v interface{}) bool {
|
||||
func (b *Body) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -332,7 +332,7 @@ func (r *Route) Comment() Expr {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two Route are equal
|
||||
func (r *Route) Equal(v interface{}) bool {
|
||||
func (r *Route) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -388,7 +388,7 @@ func (a *AtHandler) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two AtHandler are equal
|
||||
func (a *AtHandler) Equal(v interface{}) bool {
|
||||
func (a *AtHandler) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -416,7 +416,7 @@ func (a *AtDoc) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two AtDoc are equal
|
||||
func (a *AtDoc) Equal(v interface{}) bool {
|
||||
func (a *AtDoc) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -473,7 +473,7 @@ func (a *AtServer) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two AtServer are equal
|
||||
func (a *AtServer) Equal(v interface{}) bool {
|
||||
func (a *AtServer) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -521,7 +521,7 @@ func (a *AtServer) Equal(v interface{}) bool {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two ServiceRoute are equal
|
||||
func (s *ServiceRoute) Equal(v interface{}) bool {
|
||||
func (s *ServiceRoute) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -572,7 +572,7 @@ func (a *ServiceApi) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two ServiceApi are equal
|
||||
func (a *ServiceApi) Equal(v interface{}) bool {
|
||||
func (a *ServiceApi) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -630,7 +630,7 @@ func (s *Service) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two Service are equal
|
||||
func (s *Service) Equal(v interface{}) bool {
|
||||
func (s *Service) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ type SyntaxExpr struct {
|
||||
}
|
||||
|
||||
// VisitSyntaxLit implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitSyntaxLit(ctx *api.SyntaxLitContext) interface{} {
|
||||
func (v *ApiVisitor) VisitSyntaxLit(ctx *api.SyntaxLitContext) any {
|
||||
syntax := v.newExprWithToken(ctx.GetSyntaxToken())
|
||||
assign := v.newExprWithToken(ctx.GetAssign())
|
||||
version := v.newExprWithToken(ctx.GetVersion())
|
||||
@@ -34,7 +34,7 @@ func (s *SyntaxExpr) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two SyntaxExpr are equal
|
||||
func (s *SyntaxExpr) Equal(v interface{}) bool {
|
||||
func (s *SyntaxExpr) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ type (
|
||||
TypeExpr interface {
|
||||
Doc() []Expr
|
||||
Format() error
|
||||
Equal(v interface{}) bool
|
||||
Equal(v any) bool
|
||||
NameExpr() Expr
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ type (
|
||||
)
|
||||
|
||||
// VisitTypeSpec implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeSpec(ctx *api.TypeSpecContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeSpec(ctx *api.TypeSpecContext) any {
|
||||
if ctx.TypeLit() != nil {
|
||||
return []TypeExpr{ctx.TypeLit().Accept(v).(TypeExpr)}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ func (v *ApiVisitor) VisitTypeSpec(ctx *api.TypeSpecContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitTypeLit implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeLit(ctx *api.TypeLitContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeLit(ctx *api.TypeLitContext) any {
|
||||
typeLit := ctx.TypeLitBody().Accept(v)
|
||||
alias, ok := typeLit.(*TypeAlias)
|
||||
if ok {
|
||||
@@ -124,7 +124,7 @@ func (v *ApiVisitor) VisitTypeLit(ctx *api.TypeLitContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitTypeBlock implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeBlock(ctx *api.TypeBlockContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeBlock(ctx *api.TypeBlockContext) any {
|
||||
list := ctx.AllTypeBlockBody()
|
||||
var types []TypeExpr
|
||||
for _, each := range list {
|
||||
@@ -134,7 +134,7 @@ func (v *ApiVisitor) VisitTypeBlock(ctx *api.TypeBlockContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitTypeLitBody implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeLitBody(ctx *api.TypeLitBodyContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeLitBody(ctx *api.TypeLitBodyContext) any {
|
||||
if ctx.TypeAlias() != nil {
|
||||
return ctx.TypeAlias().Accept(v)
|
||||
}
|
||||
@@ -142,7 +142,7 @@ func (v *ApiVisitor) VisitTypeLitBody(ctx *api.TypeLitBodyContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitTypeBlockBody implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeBlockBody(ctx *api.TypeBlockBodyContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeBlockBody(ctx *api.TypeBlockBodyContext) any {
|
||||
if ctx.TypeBlockAlias() != nil {
|
||||
return ctx.TypeBlockAlias().Accept(v).(*TypeAlias)
|
||||
}
|
||||
@@ -150,7 +150,7 @@ func (v *ApiVisitor) VisitTypeBlockBody(ctx *api.TypeBlockBodyContext) interface
|
||||
}
|
||||
|
||||
// VisitTypeStruct implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeStruct(ctx *api.TypeStructContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeStruct(ctx *api.TypeStructContext) any {
|
||||
var st TypeStruct
|
||||
st.Name = v.newExprWithToken(ctx.GetStructName())
|
||||
|
||||
@@ -182,7 +182,7 @@ func (v *ApiVisitor) VisitTypeStruct(ctx *api.TypeStructContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitTypeBlockStruct implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeBlockStruct(ctx *api.TypeBlockStructContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeBlockStruct(ctx *api.TypeBlockStructContext) any {
|
||||
var st TypeStruct
|
||||
st.Name = v.newExprWithToken(ctx.GetStructName())
|
||||
|
||||
@@ -214,7 +214,7 @@ func (v *ApiVisitor) VisitTypeBlockStruct(ctx *api.TypeBlockStructContext) inter
|
||||
}
|
||||
|
||||
// VisitTypeBlockAlias implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeBlockAlias(ctx *api.TypeBlockAliasContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeBlockAlias(ctx *api.TypeBlockAliasContext) any {
|
||||
var alias TypeAlias
|
||||
alias.Name = v.newExprWithToken(ctx.GetAlias())
|
||||
alias.Assign = v.newExprWithToken(ctx.GetAssign())
|
||||
@@ -227,7 +227,7 @@ func (v *ApiVisitor) VisitTypeBlockAlias(ctx *api.TypeBlockAliasContext) interfa
|
||||
}
|
||||
|
||||
// VisitTypeAlias implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitTypeAlias(ctx *api.TypeAliasContext) interface{} {
|
||||
func (v *ApiVisitor) VisitTypeAlias(ctx *api.TypeAliasContext) any {
|
||||
var alias TypeAlias
|
||||
alias.Name = v.newExprWithToken(ctx.GetAlias())
|
||||
alias.Assign = v.newExprWithToken(ctx.GetAssign())
|
||||
@@ -240,7 +240,7 @@ func (v *ApiVisitor) VisitTypeAlias(ctx *api.TypeAliasContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitField implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitField(ctx *api.FieldContext) interface{} {
|
||||
func (v *ApiVisitor) VisitField(ctx *api.FieldContext) any {
|
||||
iAnonymousFiled := ctx.AnonymousFiled()
|
||||
iNormalFieldContext := ctx.NormalField()
|
||||
if iAnonymousFiled != nil {
|
||||
@@ -253,7 +253,7 @@ func (v *ApiVisitor) VisitField(ctx *api.FieldContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitNormalField implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitNormalField(ctx *api.NormalFieldContext) interface{} {
|
||||
func (v *ApiVisitor) VisitNormalField(ctx *api.NormalFieldContext) any {
|
||||
var field TypeField
|
||||
field.Name = v.newExprWithToken(ctx.GetFieldName())
|
||||
|
||||
@@ -276,7 +276,7 @@ func (v *ApiVisitor) VisitNormalField(ctx *api.NormalFieldContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitAnonymousFiled implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitAnonymousFiled(ctx *api.AnonymousFiledContext) interface{} {
|
||||
func (v *ApiVisitor) VisitAnonymousFiled(ctx *api.AnonymousFiledContext) any {
|
||||
start := ctx.GetStart()
|
||||
stop := ctx.GetStop()
|
||||
var field TypeField
|
||||
@@ -298,7 +298,7 @@ func (v *ApiVisitor) VisitAnonymousFiled(ctx *api.AnonymousFiledContext) interfa
|
||||
}
|
||||
|
||||
// VisitDataType implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitDataType(ctx *api.DataTypeContext) interface{} {
|
||||
func (v *ApiVisitor) VisitDataType(ctx *api.DataTypeContext) any {
|
||||
if ctx.ID() != nil {
|
||||
idExpr := v.newExprWithTerminalNode(ctx.ID())
|
||||
return &Literal{Literal: idExpr}
|
||||
@@ -326,7 +326,7 @@ func (v *ApiVisitor) VisitDataType(ctx *api.DataTypeContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitPointerType implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitPointerType(ctx *api.PointerTypeContext) interface{} {
|
||||
func (v *ApiVisitor) VisitPointerType(ctx *api.PointerTypeContext) any {
|
||||
nameExpr := v.newExprWithTerminalNode(ctx.ID())
|
||||
return &Pointer{
|
||||
PointerExpr: v.newExprWithText(ctx.GetText(), ctx.GetStar().GetLine(), ctx.GetStar().GetColumn(), ctx.GetStar().GetStart(), ctx.ID().GetSymbol().GetStop()),
|
||||
@@ -336,7 +336,7 @@ func (v *ApiVisitor) VisitPointerType(ctx *api.PointerTypeContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitMapType implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitMapType(ctx *api.MapTypeContext) interface{} {
|
||||
func (v *ApiVisitor) VisitMapType(ctx *api.MapTypeContext) any {
|
||||
return &Map{
|
||||
MapExpr: v.newExprWithText(ctx.GetText(), ctx.GetMapToken().GetLine(), ctx.GetMapToken().GetColumn(),
|
||||
ctx.GetMapToken().GetStart(), ctx.GetValue().GetStop().GetStop()),
|
||||
@@ -349,7 +349,7 @@ func (v *ApiVisitor) VisitMapType(ctx *api.MapTypeContext) interface{} {
|
||||
}
|
||||
|
||||
// VisitArrayType implements from api.BaseApiParserVisitor
|
||||
func (v *ApiVisitor) VisitArrayType(ctx *api.ArrayTypeContext) interface{} {
|
||||
func (v *ApiVisitor) VisitArrayType(ctx *api.ArrayTypeContext) any {
|
||||
return &Array{
|
||||
ArrayExpr: v.newExprWithText(ctx.GetText(), ctx.GetLbrack().GetLine(), ctx.GetLbrack().GetColumn(), ctx.GetLbrack().GetStart(), ctx.DataType().GetStop().GetStop()),
|
||||
LBrack: v.newExprWithToken(ctx.GetLbrack()),
|
||||
@@ -379,7 +379,7 @@ func (a *TypeAlias) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two TypeAlias are equal
|
||||
func (a *TypeAlias) Equal(v interface{}) bool {
|
||||
func (a *TypeAlias) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
@@ -609,7 +609,7 @@ func (s *TypeStruct) NameExpr() Expr {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two TypeStruct are equal
|
||||
func (s *TypeStruct) Equal(dt interface{}) bool {
|
||||
func (s *TypeStruct) Equal(dt any) bool {
|
||||
if dt == nil {
|
||||
return false
|
||||
}
|
||||
@@ -681,7 +681,7 @@ func (s *TypeStruct) Format() error {
|
||||
}
|
||||
|
||||
// Equal compares whether the element literals in two TypeField are equal
|
||||
func (t *TypeField) Equal(v interface{}) bool {
|
||||
func (t *TypeField) Equal(v any) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -5,154 +5,154 @@ type BaseApiParserVisitor struct {
|
||||
*antlr.BaseParseTreeVisitor
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitApi(ctx *ApiContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitApi(ctx *ApiContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitSpec(ctx *SpecContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitSpec(ctx *SpecContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitSyntaxLit(ctx *SyntaxLitContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitSyntaxLit(ctx *SyntaxLitContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitImportSpec(ctx *ImportSpecContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitImportSpec(ctx *ImportSpecContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitImportLit(ctx *ImportLitContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitImportLit(ctx *ImportLitContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitImportBlock(ctx *ImportBlockContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitImportBlock(ctx *ImportBlockContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitImportBlockValue(ctx *ImportBlockValueContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitImportBlockValue(ctx *ImportBlockValueContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitImportValue(ctx *ImportValueContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitImportValue(ctx *ImportValueContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitInfoSpec(ctx *InfoSpecContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitInfoSpec(ctx *InfoSpecContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeSpec(ctx *TypeSpecContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeSpec(ctx *TypeSpecContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeLit(ctx *TypeLitContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeLit(ctx *TypeLitContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlock(ctx *TypeBlockContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlock(ctx *TypeBlockContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeLitBody(ctx *TypeLitBodyContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeLitBody(ctx *TypeLitBodyContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlockBody(ctx *TypeBlockBodyContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlockBody(ctx *TypeBlockBodyContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeStruct(ctx *TypeStructContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeStruct(ctx *TypeStructContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeAlias(ctx *TypeAliasContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeAlias(ctx *TypeAliasContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlockStruct(ctx *TypeBlockStructContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlockStruct(ctx *TypeBlockStructContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlockAlias(ctx *TypeBlockAliasContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitTypeBlockAlias(ctx *TypeBlockAliasContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitField(ctx *FieldContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitField(ctx *FieldContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitNormalField(ctx *NormalFieldContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitNormalField(ctx *NormalFieldContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitAnonymousFiled(ctx *AnonymousFiledContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitAnonymousFiled(ctx *AnonymousFiledContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitDataType(ctx *DataTypeContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitDataType(ctx *DataTypeContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitPointerType(ctx *PointerTypeContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitPointerType(ctx *PointerTypeContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitMapType(ctx *MapTypeContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitMapType(ctx *MapTypeContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitArrayType(ctx *ArrayTypeContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitArrayType(ctx *ArrayTypeContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitServiceSpec(ctx *ServiceSpecContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitServiceSpec(ctx *ServiceSpecContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitAtServer(ctx *AtServerContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitAtServer(ctx *AtServerContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitServiceApi(ctx *ServiceApiContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitServiceApi(ctx *ServiceApiContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitServiceRoute(ctx *ServiceRouteContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitServiceRoute(ctx *ServiceRouteContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitAtDoc(ctx *AtDocContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitAtDoc(ctx *AtDocContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitAtHandler(ctx *AtHandlerContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitAtHandler(ctx *AtHandlerContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitRoute(ctx *RouteContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitRoute(ctx *RouteContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitBody(ctx *BodyContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitBody(ctx *BodyContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitReplybody(ctx *ReplybodyContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitReplybody(ctx *ReplybodyContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitKvLit(ctx *KvLitContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitKvLit(ctx *KvLitContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitServiceName(ctx *ServiceNameContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitServiceName(ctx *ServiceNameContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitPath(ctx *PathContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitPath(ctx *PathContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
func (v *BaseApiParserVisitor) VisitPathItem(ctx *PathItemContext) interface{} {
|
||||
func (v *BaseApiParserVisitor) VisitPathItem(ctx *PathItemContext) any {
|
||||
return v.VisitChildren(ctx)
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ func (s *ApiContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) st
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitApi(s)
|
||||
@@ -506,7 +506,7 @@ func (s *SpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitSpec(s)
|
||||
|
||||
@@ -22,7 +22,7 @@ func (s *SyntaxLitContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitSyntaxLit(s)
|
||||
@@ -146,7 +146,7 @@ func (s *ImportSpecContext) ToStringTree(ruleNames []string, recog antlr.Recogni
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitImportSpec(s)
|
||||
@@ -269,7 +269,7 @@ func (s *ImportLitContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitImportLit(s)
|
||||
@@ -400,7 +400,7 @@ func (s *ImportBlockContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitImportBlock(s)
|
||||
@@ -522,7 +522,7 @@ func (s *ImportBlockValueContext) ToStringTree(ruleNames []string, recog antlr.R
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitImportBlockValue(s)
|
||||
@@ -611,7 +611,7 @@ func (s *ImportValueContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitImportValue(s)
|
||||
|
||||
@@ -87,7 +87,7 @@ func (s *InfoSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitInfoSpec(s)
|
||||
@@ -225,7 +225,7 @@ func (s *TypeSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeSpec(s)
|
||||
@@ -348,7 +348,7 @@ func (s *TypeLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeLit(s)
|
||||
@@ -501,7 +501,7 @@ func (s *TypeBlockContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeBlock(s)
|
||||
@@ -639,7 +639,7 @@ func (s *TypeLitBodyContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeLitBody(s)
|
||||
|
||||
@@ -76,7 +76,7 @@ func (s *TypeBlockBodyContext) ToStringTree(ruleNames []string, recog antlr.Reco
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeBlockBody(s)
|
||||
@@ -249,7 +249,7 @@ func (s *TypeStructContext) ToStringTree(ruleNames []string, recog antlr.Recogni
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeStruct(s)
|
||||
@@ -421,7 +421,7 @@ func (s *TypeAliasContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeAlias(s)
|
||||
@@ -604,7 +604,7 @@ func (s *TypeBlockStructContext) ToStringTree(ruleNames []string, recog antlr.Re
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeBlockStruct(s)
|
||||
|
||||
@@ -92,7 +92,7 @@ func (s *TypeBlockAliasContext) ToStringTree(ruleNames []string, recog antlr.Rec
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitTypeBlockAlias(s)
|
||||
@@ -220,7 +220,7 @@ func (s *FieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitField(s)
|
||||
@@ -363,7 +363,7 @@ func (s *NormalFieldContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitNormalField(s)
|
||||
@@ -484,7 +484,7 @@ func (s *AnonymousFiledContext) ToStringTree(ruleNames []string, recog antlr.Rec
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitAnonymousFiled(s)
|
||||
@@ -654,7 +654,7 @@ func (s *DataTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitDataType(s)
|
||||
|
||||
@@ -155,7 +155,7 @@ func (s *PointerTypeContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitPointerType(s)
|
||||
@@ -321,7 +321,7 @@ func (s *MapTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitMapType(s)
|
||||
@@ -471,7 +471,7 @@ func (s *ArrayTypeContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitArrayType(s)
|
||||
@@ -590,7 +590,7 @@ func (s *ServiceSpecContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitServiceSpec(s)
|
||||
|
||||
@@ -82,7 +82,7 @@ func (s *AtServerContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitAtServer(s)
|
||||
@@ -266,7 +266,7 @@ func (s *ServiceApiContext) ToStringTree(ruleNames []string, recog antlr.Recogni
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitServiceApi(s)
|
||||
@@ -428,7 +428,7 @@ func (s *ServiceRouteContext) ToStringTree(ruleNames []string, recog antlr.Recog
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitServiceRoute(s)
|
||||
@@ -597,7 +597,7 @@ func (s *AtDocContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitAtDoc(s)
|
||||
|
||||
@@ -64,7 +64,7 @@ func (s *AtHandlerContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitAtHandler(s)
|
||||
@@ -220,7 +220,7 @@ func (s *RouteContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitRoute(s)
|
||||
@@ -368,7 +368,7 @@ func (s *BodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitBody(s)
|
||||
@@ -518,7 +518,7 @@ func (s *ReplybodyContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitReplybody(s)
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
// The apiparser_parser.go file was split into multiple files because it
|
||||
// was too large and caused a possible memory overflow during goctl installation.
|
||||
|
||||
func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitKvLit(s)
|
||||
@@ -115,7 +115,7 @@ func (s *ServiceNameContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitServiceName(s)
|
||||
@@ -245,7 +245,7 @@ func (s *PathContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitPath(s)
|
||||
@@ -428,7 +428,7 @@ func (s *PathItemContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
func (s *PathItemContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
func (s *PathItemContext) Accept(visitor antlr.ParseTreeVisitor) any {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
return t.VisitPathItem(s)
|
||||
|
||||
@@ -8,116 +8,116 @@ type ApiParserVisitor interface {
|
||||
antlr.ParseTreeVisitor
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#api.
|
||||
VisitApi(ctx *ApiContext) interface{}
|
||||
VisitApi(ctx *ApiContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#spec.
|
||||
VisitSpec(ctx *SpecContext) interface{}
|
||||
VisitSpec(ctx *SpecContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#syntaxLit.
|
||||
VisitSyntaxLit(ctx *SyntaxLitContext) interface{}
|
||||
VisitSyntaxLit(ctx *SyntaxLitContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importSpec.
|
||||
VisitImportSpec(ctx *ImportSpecContext) interface{}
|
||||
VisitImportSpec(ctx *ImportSpecContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importLit.
|
||||
VisitImportLit(ctx *ImportLitContext) interface{}
|
||||
VisitImportLit(ctx *ImportLitContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importBlock.
|
||||
VisitImportBlock(ctx *ImportBlockContext) interface{}
|
||||
VisitImportBlock(ctx *ImportBlockContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importBlockValue.
|
||||
VisitImportBlockValue(ctx *ImportBlockValueContext) interface{}
|
||||
VisitImportBlockValue(ctx *ImportBlockValueContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importValue.
|
||||
VisitImportValue(ctx *ImportValueContext) interface{}
|
||||
VisitImportValue(ctx *ImportValueContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#infoSpec.
|
||||
VisitInfoSpec(ctx *InfoSpecContext) interface{}
|
||||
VisitInfoSpec(ctx *InfoSpecContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeSpec.
|
||||
VisitTypeSpec(ctx *TypeSpecContext) interface{}
|
||||
VisitTypeSpec(ctx *TypeSpecContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeLit.
|
||||
VisitTypeLit(ctx *TypeLitContext) interface{}
|
||||
VisitTypeLit(ctx *TypeLitContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlock.
|
||||
VisitTypeBlock(ctx *TypeBlockContext) interface{}
|
||||
VisitTypeBlock(ctx *TypeBlockContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeLitBody.
|
||||
VisitTypeLitBody(ctx *TypeLitBodyContext) interface{}
|
||||
VisitTypeLitBody(ctx *TypeLitBodyContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlockBody.
|
||||
VisitTypeBlockBody(ctx *TypeBlockBodyContext) interface{}
|
||||
VisitTypeBlockBody(ctx *TypeBlockBodyContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeStruct.
|
||||
VisitTypeStruct(ctx *TypeStructContext) interface{}
|
||||
VisitTypeStruct(ctx *TypeStructContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeAlias.
|
||||
VisitTypeAlias(ctx *TypeAliasContext) interface{}
|
||||
VisitTypeAlias(ctx *TypeAliasContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlockStruct.
|
||||
VisitTypeBlockStruct(ctx *TypeBlockStructContext) interface{}
|
||||
VisitTypeBlockStruct(ctx *TypeBlockStructContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlockAlias.
|
||||
VisitTypeBlockAlias(ctx *TypeBlockAliasContext) interface{}
|
||||
VisitTypeBlockAlias(ctx *TypeBlockAliasContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#field.
|
||||
VisitField(ctx *FieldContext) interface{}
|
||||
VisitField(ctx *FieldContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#normalField.
|
||||
VisitNormalField(ctx *NormalFieldContext) interface{}
|
||||
VisitNormalField(ctx *NormalFieldContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#anonymousFiled.
|
||||
VisitAnonymousFiled(ctx *AnonymousFiledContext) interface{}
|
||||
VisitAnonymousFiled(ctx *AnonymousFiledContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#dataType.
|
||||
VisitDataType(ctx *DataTypeContext) interface{}
|
||||
VisitDataType(ctx *DataTypeContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#pointerType.
|
||||
VisitPointerType(ctx *PointerTypeContext) interface{}
|
||||
VisitPointerType(ctx *PointerTypeContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#mapType.
|
||||
VisitMapType(ctx *MapTypeContext) interface{}
|
||||
VisitMapType(ctx *MapTypeContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#arrayType.
|
||||
VisitArrayType(ctx *ArrayTypeContext) interface{}
|
||||
VisitArrayType(ctx *ArrayTypeContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceSpec.
|
||||
VisitServiceSpec(ctx *ServiceSpecContext) interface{}
|
||||
VisitServiceSpec(ctx *ServiceSpecContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#atServer.
|
||||
VisitAtServer(ctx *AtServerContext) interface{}
|
||||
VisitAtServer(ctx *AtServerContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceApi.
|
||||
VisitServiceApi(ctx *ServiceApiContext) interface{}
|
||||
VisitServiceApi(ctx *ServiceApiContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceRoute.
|
||||
VisitServiceRoute(ctx *ServiceRouteContext) interface{}
|
||||
VisitServiceRoute(ctx *ServiceRouteContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#atDoc.
|
||||
VisitAtDoc(ctx *AtDocContext) interface{}
|
||||
VisitAtDoc(ctx *AtDocContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#atHandler.
|
||||
VisitAtHandler(ctx *AtHandlerContext) interface{}
|
||||
VisitAtHandler(ctx *AtHandlerContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#route.
|
||||
VisitRoute(ctx *RouteContext) interface{}
|
||||
VisitRoute(ctx *RouteContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#body.
|
||||
VisitBody(ctx *BodyContext) interface{}
|
||||
VisitBody(ctx *BodyContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#replybody.
|
||||
VisitReplybody(ctx *ReplybodyContext) interface{}
|
||||
VisitReplybody(ctx *ReplybodyContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#kvLit.
|
||||
VisitKvLit(ctx *KvLitContext) interface{}
|
||||
VisitKvLit(ctx *KvLitContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceName.
|
||||
VisitServiceName(ctx *ServiceNameContext) interface{}
|
||||
VisitServiceName(ctx *ServiceNameContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#path.
|
||||
VisitPath(ctx *PathContext) interface{}
|
||||
VisitPath(ctx *PathContext) any
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#pathItem.
|
||||
VisitPathItem(ctx *PathItemContext) interface{}
|
||||
VisitPathItem(ctx *PathItemContext) any
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ var testApi string
|
||||
var parser = ast.NewParser(ast.WithParserPrefix("test.api"), ast.WithParserDebug())
|
||||
|
||||
func TestApi(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.Api().Accept(visitor)
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ func TestApi(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestApiSyntax(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.Api().Accept(visitor)
|
||||
}
|
||||
parser.Accept(fn, `
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var importAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var importAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.ImportSpec().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var infoAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var infoAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.InfoSpec().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func TestBody(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.Body().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -33,7 +33,7 @@ func TestBody(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRoute(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.Route().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -196,7 +196,7 @@ func TestRoute(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAtHandler(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.AtHandler().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -236,7 +236,7 @@ func TestAtHandler(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAtDoc(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.AtDoc().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -308,7 +308,7 @@ func TestAtDoc(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceRoute(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.ServiceRoute().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -370,7 +370,7 @@ func TestServiceRoute(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceApi(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.ServiceApi().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -452,7 +452,7 @@ func TestServiceApi(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAtServer(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.AtServer().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -520,7 +520,7 @@ func TestAtServer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceSpec(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.ServiceSpec().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var syntaxAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var syntaxAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.SyntaxLit().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var fieldAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var fieldAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.Field().Accept(visitor)
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ func TestField(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_ID(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.DataType().Accept(visitor)
|
||||
}
|
||||
t.Run("Struct", func(t *testing.T) {
|
||||
@@ -117,7 +117,7 @@ func TestDataType_ID(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Map(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.MapType().Accept(visitor)
|
||||
}
|
||||
t.Run("basicKey", func(t *testing.T) {
|
||||
@@ -147,7 +147,7 @@ func TestDataType_Map(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Array(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.ArrayType().Accept(visitor)
|
||||
}
|
||||
t.Run("basic", func(t *testing.T) {
|
||||
@@ -200,7 +200,7 @@ func TestDataType_Array(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Interface(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.DataType().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -222,7 +222,7 @@ func TestDataType_Interface(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Time(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.DataType().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -232,7 +232,7 @@ func TestDataType_Time(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Pointer(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.PointerType().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -252,7 +252,7 @@ func TestDataType_Pointer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAlias(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeAlias().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -281,7 +281,7 @@ func TestAlias(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeStruct(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeStruct().Accept(visitor)
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ func TestTypeStruct(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeBlock(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeBlock().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -366,7 +366,7 @@ func TestTypeBlock(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeLit(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeLit().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -435,7 +435,7 @@ func TestTypeLit(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeUnExported(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeSpec().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user