parse

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFileFunctionsDescription

func BuildFileFunctionsDescription(file string, funs []*Function) string

func BuildFuncListDescription

func BuildFuncListDescription(funs []*Function) string

func GetTypeStr

func GetTypeStr(t ast.Expr) string

func MakeFileFuncSet

func MakeFileFuncSet(funs []*Function) map[string][]*Function

Types

type Field

type Field struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type Function

type Function struct {
	Name    string   `json:"name"`
	Params  []*Field `json:"params"`
	Results []*Field `json:"results"`
	File    string   `json:"file"`
	Type    string   `json:"type"`
	Source  string   `json:"source"`
	Line    int      `json:"line"`
}

func GetFuncList

func GetFuncList(frames *runtime.Frames) (funs []*Function)

func GetFuncListWithStackTraces

func GetFuncListWithStackTraces(stackTraces []*StackTrace) (funs []*Function)

func NewFunction

func NewFunction(name string, params, results []*Field, file, source string) *Function

func ReadFuncSource

func ReadFuncSource(file, fun string, strict bool) (*Function, error)

ReadFuncSource read parse source code

type StackTrace

type StackTrace struct {
	Func string `json:"func"`
	File string `json:"file"`
	Line int    `json:"line"`
}

func StackTraces

func StackTraces(stack []byte) []*StackTrace

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL