typevars

package
v0.0.0-...-d69f115 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeVar2String

func TypeVar2String(tv Interface) string

func UnmarshalDataType

func UnmarshalDataType(rawMessage *json.RawMessage) (gotypes.DataType, error)

Types

type Argument

type Argument struct {
	// Location of a function
	Function *Variable
	// Return type position
	Index int
}

Argument represent an address of a function/method argument

func MakeArgument

func MakeArgument(v *Variable, index int) *Argument

func (*Argument) GetType

func (a *Argument) GetType() Type

func (*Argument) MarshalJSON

func (o *Argument) MarshalJSON() (b []byte, e error)

type CGO

type CGO struct {
	gotypes.DataType `json:"datatype"`
	Package          string `json:"package"`
}

func (*CGO) GetType

func (c *CGO) GetType() Type

func (*CGO) MarshalJSON

func (o *CGO) MarshalJSON() (b []byte, e error)

func (*CGO) UnmarshalJSON

func (o *CGO) UnmarshalJSON(b []byte) error

type Constant

type Constant struct {
	gotypes.DataType `json:"datatype"`
	Package          string `json:"package"`
}

Constant to represent: - basic literal type - composite literal type - type casting - struct type expression

func MakeConstant

func MakeConstant(pkg string, datatype gotypes.DataType) *Constant

func (*Constant) GetType

func (c *Constant) GetType() Type

func (*Constant) MarshalJSON

func (o *Constant) MarshalJSON() (b []byte, e error)

func (*Constant) UnmarshalJSON

func (o *Constant) UnmarshalJSON(b []byte) error

type Field

type Field struct {
	X     *Variable
	Name  string
	Index int
	Pos   string
}

func MakeField

func MakeField(v *Variable, field string, index int, pos string) *Field

func (*Field) GetType

func (f *Field) GetType() Type

func (*Field) MarshalJSON

func (o *Field) MarshalJSON() (b []byte, e error)

type Interface

type Interface interface {
	GetType() Type
}

type ListKey

type ListKey struct{}

func MakeListKey

func MakeListKey() *ListKey

func (*ListKey) GetType

func (l *ListKey) GetType() Type

func (*ListKey) MarshalJSON

func (o *ListKey) MarshalJSON() (b []byte, e error)

type ListValue

type ListValue struct {
	X *Variable
}

func MakeListValue

func MakeListValue(v *Variable) *ListValue

func (*ListValue) GetType

func (l *ListValue) GetType() Type

func (*ListValue) MarshalJSON

func (o *ListValue) MarshalJSON() (b []byte, e error)

type MapKey

type MapKey struct {
	X *Variable
}

func MakeMapKey

func MakeMapKey(v *Variable) *MapKey

func (*MapKey) GetType

func (m *MapKey) GetType() Type

func (*MapKey) MarshalJSON

func (o *MapKey) MarshalJSON() (b []byte, e error)

type MapValue

type MapValue struct {
	X *Variable
}

func MakeMapValue

func MakeMapValue(v *Variable) *MapValue

func (*MapValue) GetType

func (m *MapValue) GetType() Type

func (*MapValue) MarshalJSON

func (o *MapValue) MarshalJSON() (b []byte, e error)

type RangeKey

type RangeKey struct {
	X *Variable
}

func MakeRangeKey

func MakeRangeKey(v *Variable) *RangeKey

func (*RangeKey) GetType

func (m *RangeKey) GetType() Type

func (*RangeKey) MarshalJSON

func (o *RangeKey) MarshalJSON() (b []byte, e error)

type RangeValue

type RangeValue struct {
	X *Variable
}

func MakeRangeValue

func MakeRangeValue(v *Variable) *RangeValue

func (*RangeValue) GetType

func (m *RangeValue) GetType() Type

func (*RangeValue) MarshalJSON

func (o *RangeValue) MarshalJSON() (b []byte, e error)

type ReturnType

type ReturnType struct {
	// Location of a function
	Function *Variable
	// Return type position
	Index int
}

func MakeReturn

func MakeReturn(v *Variable, index int) *ReturnType

func (*ReturnType) GetType

func (a *ReturnType) GetType() Type

func (*ReturnType) MarshalJSON

func (o *ReturnType) MarshalJSON() (b []byte, e error)

type Type

type Type string
var ArgumentType Type = "Argument"
var CGOType Type = "CGO"
var ConstantType Type = "Constant"
var FieldType Type = "Field"
var ListKeyType Type = "ListKey"
var ListValueType Type = "ListValue"
var MapKeyType Type = "MapKey"
var MapValueType Type = "MapValue"
var RangeKeyType Type = "RangeKey"
var RangeValueType Type = "RangeValue"
var ReturnTypeType Type = "ReturnType"
var VariableType Type = "Variable"

type Variable

type Variable struct {
	Name    string
	Pos     string
	Package string
}

Variable to represent: - local variable: usually in <file>:<ln>:<name> form - global variable - qid-ed variable

func MakeLocalVar

func MakeLocalVar(name, pos string) *Variable

func MakeVar

func MakeVar(packageName, name, pos string) *Variable

func MakeVirtualVar

func MakeVirtualVar(index int) *Variable

func VariableFromSymbolDef

func VariableFromSymbolDef(def *symbols.SymbolDef) *Variable

func (*Variable) GetType

func (v *Variable) GetType() Type

func (*Variable) MarshalJSON

func (o *Variable) MarshalJSON() (b []byte, e error)

func (*Variable) String

func (v *Variable) String() string

Jump to

Keyboard shortcuts

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