github.com/goplus/gossa@v0.3.25/pkg/go/ast/go118_export.go (about)

     1  // export by github.com/goplus/gossa/cmd/qexp
     2  
     3  //go:build go1.18
     4  // +build go1.18
     5  
     6  package ast
     7  
     8  import (
     9  	q "go/ast"
    10  
    11  	"go/constant"
    12  	"reflect"
    13  
    14  	"github.com/goplus/gossa"
    15  )
    16  
    17  func init() {
    18  	gossa.RegisterPackage(&gossa.Package{
    19  		Name: "ast",
    20  		Path: "go/ast",
    21  		Deps: map[string]string{
    22  			"bytes":      "bytes",
    23  			"fmt":        "fmt",
    24  			"go/scanner": "scanner",
    25  			"go/token":   "token",
    26  			"io":         "io",
    27  			"os":         "os",
    28  			"reflect":    "reflect",
    29  			"sort":       "sort",
    30  			"strconv":    "strconv",
    31  			"strings":    "strings",
    32  		},
    33  		Interfaces: map[string]reflect.Type{
    34  			"Decl":    reflect.TypeOf((*q.Decl)(nil)).Elem(),
    35  			"Expr":    reflect.TypeOf((*q.Expr)(nil)).Elem(),
    36  			"Node":    reflect.TypeOf((*q.Node)(nil)).Elem(),
    37  			"Spec":    reflect.TypeOf((*q.Spec)(nil)).Elem(),
    38  			"Stmt":    reflect.TypeOf((*q.Stmt)(nil)).Elem(),
    39  			"Visitor": reflect.TypeOf((*q.Visitor)(nil)).Elem(),
    40  		},
    41  		NamedTypes: map[string]gossa.NamedType{
    42  			"ArrayType":      {reflect.TypeOf((*q.ArrayType)(nil)).Elem(), "", "End,Pos,exprNode"},
    43  			"AssignStmt":     {reflect.TypeOf((*q.AssignStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    44  			"BadDecl":        {reflect.TypeOf((*q.BadDecl)(nil)).Elem(), "", "End,Pos,declNode"},
    45  			"BadExpr":        {reflect.TypeOf((*q.BadExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    46  			"BadStmt":        {reflect.TypeOf((*q.BadStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    47  			"BasicLit":       {reflect.TypeOf((*q.BasicLit)(nil)).Elem(), "", "End,Pos,exprNode"},
    48  			"BinaryExpr":     {reflect.TypeOf((*q.BinaryExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    49  			"BlockStmt":      {reflect.TypeOf((*q.BlockStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    50  			"BranchStmt":     {reflect.TypeOf((*q.BranchStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    51  			"CallExpr":       {reflect.TypeOf((*q.CallExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    52  			"CaseClause":     {reflect.TypeOf((*q.CaseClause)(nil)).Elem(), "", "End,Pos,stmtNode"},
    53  			"ChanDir":        {reflect.TypeOf((*q.ChanDir)(nil)).Elem(), "", ""},
    54  			"ChanType":       {reflect.TypeOf((*q.ChanType)(nil)).Elem(), "", "End,Pos,exprNode"},
    55  			"CommClause":     {reflect.TypeOf((*q.CommClause)(nil)).Elem(), "", "End,Pos,stmtNode"},
    56  			"Comment":        {reflect.TypeOf((*q.Comment)(nil)).Elem(), "", "End,Pos"},
    57  			"CommentGroup":   {reflect.TypeOf((*q.CommentGroup)(nil)).Elem(), "", "End,Pos,Text"},
    58  			"CommentMap":     {reflect.TypeOf((*q.CommentMap)(nil)).Elem(), "Comments,Filter,String,Update,addComment", ""},
    59  			"CompositeLit":   {reflect.TypeOf((*q.CompositeLit)(nil)).Elem(), "", "End,Pos,exprNode"},
    60  			"DeclStmt":       {reflect.TypeOf((*q.DeclStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    61  			"DeferStmt":      {reflect.TypeOf((*q.DeferStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    62  			"Ellipsis":       {reflect.TypeOf((*q.Ellipsis)(nil)).Elem(), "", "End,Pos,exprNode"},
    63  			"EmptyStmt":      {reflect.TypeOf((*q.EmptyStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    64  			"ExprStmt":       {reflect.TypeOf((*q.ExprStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    65  			"Field":          {reflect.TypeOf((*q.Field)(nil)).Elem(), "", "End,Pos"},
    66  			"FieldFilter":    {reflect.TypeOf((*q.FieldFilter)(nil)).Elem(), "", ""},
    67  			"FieldList":      {reflect.TypeOf((*q.FieldList)(nil)).Elem(), "", "End,NumFields,Pos"},
    68  			"File":           {reflect.TypeOf((*q.File)(nil)).Elem(), "", "End,Pos"},
    69  			"Filter":         {reflect.TypeOf((*q.Filter)(nil)).Elem(), "", ""},
    70  			"ForStmt":        {reflect.TypeOf((*q.ForStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    71  			"FuncDecl":       {reflect.TypeOf((*q.FuncDecl)(nil)).Elem(), "", "End,Pos,declNode"},
    72  			"FuncLit":        {reflect.TypeOf((*q.FuncLit)(nil)).Elem(), "", "End,Pos,exprNode"},
    73  			"FuncType":       {reflect.TypeOf((*q.FuncType)(nil)).Elem(), "", "End,Pos,exprNode"},
    74  			"GenDecl":        {reflect.TypeOf((*q.GenDecl)(nil)).Elem(), "", "End,Pos,declNode"},
    75  			"GoStmt":         {reflect.TypeOf((*q.GoStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    76  			"Ident":          {reflect.TypeOf((*q.Ident)(nil)).Elem(), "", "End,IsExported,Pos,String,exprNode"},
    77  			"IfStmt":         {reflect.TypeOf((*q.IfStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    78  			"ImportSpec":     {reflect.TypeOf((*q.ImportSpec)(nil)).Elem(), "", "End,Pos,specNode"},
    79  			"Importer":       {reflect.TypeOf((*q.Importer)(nil)).Elem(), "", ""},
    80  			"IncDecStmt":     {reflect.TypeOf((*q.IncDecStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    81  			"IndexExpr":      {reflect.TypeOf((*q.IndexExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    82  			"IndexListExpr":  {reflect.TypeOf((*q.IndexListExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    83  			"InterfaceType":  {reflect.TypeOf((*q.InterfaceType)(nil)).Elem(), "", "End,Pos,exprNode"},
    84  			"KeyValueExpr":   {reflect.TypeOf((*q.KeyValueExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    85  			"LabeledStmt":    {reflect.TypeOf((*q.LabeledStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    86  			"MapType":        {reflect.TypeOf((*q.MapType)(nil)).Elem(), "", "End,Pos,exprNode"},
    87  			"MergeMode":      {reflect.TypeOf((*q.MergeMode)(nil)).Elem(), "", ""},
    88  			"ObjKind":        {reflect.TypeOf((*q.ObjKind)(nil)).Elem(), "String", ""},
    89  			"Object":         {reflect.TypeOf((*q.Object)(nil)).Elem(), "", "Pos"},
    90  			"Package":        {reflect.TypeOf((*q.Package)(nil)).Elem(), "", "End,Pos"},
    91  			"ParenExpr":      {reflect.TypeOf((*q.ParenExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    92  			"RangeStmt":      {reflect.TypeOf((*q.RangeStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    93  			"ReturnStmt":     {reflect.TypeOf((*q.ReturnStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    94  			"Scope":          {reflect.TypeOf((*q.Scope)(nil)).Elem(), "", "Insert,Lookup,String"},
    95  			"SelectStmt":     {reflect.TypeOf((*q.SelectStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    96  			"SelectorExpr":   {reflect.TypeOf((*q.SelectorExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    97  			"SendStmt":       {reflect.TypeOf((*q.SendStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
    98  			"SliceExpr":      {reflect.TypeOf((*q.SliceExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
    99  			"StarExpr":       {reflect.TypeOf((*q.StarExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
   100  			"StructType":     {reflect.TypeOf((*q.StructType)(nil)).Elem(), "", "End,Pos,exprNode"},
   101  			"SwitchStmt":     {reflect.TypeOf((*q.SwitchStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
   102  			"TypeAssertExpr": {reflect.TypeOf((*q.TypeAssertExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
   103  			"TypeSpec":       {reflect.TypeOf((*q.TypeSpec)(nil)).Elem(), "", "End,Pos,specNode"},
   104  			"TypeSwitchStmt": {reflect.TypeOf((*q.TypeSwitchStmt)(nil)).Elem(), "", "End,Pos,stmtNode"},
   105  			"UnaryExpr":      {reflect.TypeOf((*q.UnaryExpr)(nil)).Elem(), "", "End,Pos,exprNode"},
   106  			"ValueSpec":      {reflect.TypeOf((*q.ValueSpec)(nil)).Elem(), "", "End,Pos,specNode"},
   107  		},
   108  		AliasTypes: map[string]reflect.Type{},
   109  		Vars:       map[string]reflect.Value{},
   110  		Funcs: map[string]reflect.Value{
   111  			"FileExports":       reflect.ValueOf(q.FileExports),
   112  			"FilterDecl":        reflect.ValueOf(q.FilterDecl),
   113  			"FilterFile":        reflect.ValueOf(q.FilterFile),
   114  			"FilterPackage":     reflect.ValueOf(q.FilterPackage),
   115  			"Fprint":            reflect.ValueOf(q.Fprint),
   116  			"Inspect":           reflect.ValueOf(q.Inspect),
   117  			"IsExported":        reflect.ValueOf(q.IsExported),
   118  			"MergePackageFiles": reflect.ValueOf(q.MergePackageFiles),
   119  			"NewCommentMap":     reflect.ValueOf(q.NewCommentMap),
   120  			"NewIdent":          reflect.ValueOf(q.NewIdent),
   121  			"NewObj":            reflect.ValueOf(q.NewObj),
   122  			"NewPackage":        reflect.ValueOf(q.NewPackage),
   123  			"NewScope":          reflect.ValueOf(q.NewScope),
   124  			"NotNilFilter":      reflect.ValueOf(q.NotNilFilter),
   125  			"PackageExports":    reflect.ValueOf(q.PackageExports),
   126  			"Print":             reflect.ValueOf(q.Print),
   127  			"SortImports":       reflect.ValueOf(q.SortImports),
   128  			"Walk":              reflect.ValueOf(q.Walk),
   129  		},
   130  		TypedConsts: map[string]gossa.TypedConst{
   131  			"Bad":                        {reflect.TypeOf(q.Bad), constant.MakeInt64(int64(q.Bad))},
   132  			"Con":                        {reflect.TypeOf(q.Con), constant.MakeInt64(int64(q.Con))},
   133  			"FilterFuncDuplicates":       {reflect.TypeOf(q.FilterFuncDuplicates), constant.MakeInt64(int64(q.FilterFuncDuplicates))},
   134  			"FilterImportDuplicates":     {reflect.TypeOf(q.FilterImportDuplicates), constant.MakeInt64(int64(q.FilterImportDuplicates))},
   135  			"FilterUnassociatedComments": {reflect.TypeOf(q.FilterUnassociatedComments), constant.MakeInt64(int64(q.FilterUnassociatedComments))},
   136  			"Fun":                        {reflect.TypeOf(q.Fun), constant.MakeInt64(int64(q.Fun))},
   137  			"Lbl":                        {reflect.TypeOf(q.Lbl), constant.MakeInt64(int64(q.Lbl))},
   138  			"Pkg":                        {reflect.TypeOf(q.Pkg), constant.MakeInt64(int64(q.Pkg))},
   139  			"RECV":                       {reflect.TypeOf(q.RECV), constant.MakeInt64(int64(q.RECV))},
   140  			"SEND":                       {reflect.TypeOf(q.SEND), constant.MakeInt64(int64(q.SEND))},
   141  			"Typ":                        {reflect.TypeOf(q.Typ), constant.MakeInt64(int64(q.Typ))},
   142  			"Var":                        {reflect.TypeOf(q.Var), constant.MakeInt64(int64(q.Var))},
   143  		},
   144  		UntypedConsts: map[string]gossa.UntypedConst{},
   145  	})
   146  }