crystal

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterTypes

func FilterTypes(lib *Type, symbol string) map[KType][]*Result

func FindType

func FindType(lib *Type, symbol string) any

Types

type Constant

type Constant struct {
	Name    string `json:"name"`
	Value   string `json:"value"`
	Summary string `json:"summary,omitempty"`
	Doc     string `json:"doc,omitempty"`
}

type Definition

type Definition struct {
	Name     string    `json:"name"`
	Args     string    `json:"args_string,omitempty"`
	Summary  string    `json:"summary,omitempty"`
	Doc      string    `json:"doc,omitempty"`
	HTMLID   string    `json:"html_id"`
	Abstract bool      `json:"abstract"`
	Alias    bool      `json:"alias"`
	Aliased  string    `json:"aliased,omitempty"`
	Enum     bool      `json:"enum"`
	Location *Location `json:"location"`
	Def      *struct {
		Visibility string `json:"visibility"`
	} `json:"def,omitempty"`
}

type KType

type KType int
const (
	KConstant KType = iota
	KModule
	KClass
	KStruct
	KEnum
	KAlias
	KConstructor
	KCMethod
	KIMethod
	KMacro
)

type Location

type Location struct {
	File string `json:"filename"`
	Line int    `json:"line_number"`
}

type Query

type Query struct {
	Library string
	Types   []string
	Symbol  string
}

func ParseQuery

func ParseQuery(args []string) (*Query, error)

1: library Symbol 2: library Type Symbol 1: library Type.Symbol 1: library Type#Symbol 1: library Type::Symbol 2: library Type::Symbol Symbol

type Result

type Result struct {
	Value  []string
	Source *Location
}

type SuperClass

type SuperClass struct {
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	Kind     string `json:"kind"`
}

type TopLevel

type TopLevel struct {
	Program Type `json:"program"`
}

type Type

type Type struct {
	Name            string        `json:"name"`
	FullName        string        `json:"full_name"`
	Summary         string        `json:"summary"`
	Doc             string        `json:"doc"`
	Kind            string        `json:"kind"`
	Abstract        bool          `json:"abstract"`
	Program         bool          `json:"program"`
	Enum            bool          `json:"enum"`
	Alias           bool          `json:"alias"`
	Const           bool          `json:"const"`
	Locations       []*Location   `json:"locations"`
	Aliased         string        `json:"aliased,omitempty"`
	SuperClass      *SuperClass   `json:"superclass,omitempty"`
	Constants       []*Constant   `json:"constants,omitempty"`
	Ancestors       []*SuperClass `json:"ancestors,omitempty"`
	Included        []*SuperClass `json:"included_modules,omitempty"`
	Extended        []*SuperClass `json:"extended_modules,omitempty"`
	Constructors    []*Definition `json:"constructors,omitempty"`
	ClassMethods    []*Definition `json:"class_methods,omitempty"`
	InstanceMethods []*Definition `json:"instance_methods,omitempty"`
	Macros          []*Definition `json:"macros,omitempty"`
	Types           []*Type       `json:"types,omitempty"`
}

func ResolveType

func ResolveType(lib *Type, names []string) *Type

Jump to

Keyboard shortcuts

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