ast

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TokenModifierDeclaration    SemanticTokenModifier = 0x01
	TokenModifierDefinition                           = 0x02
	TokenModifierReadonly                             = 0x04
	TokenModifierStatic                               = 0x08
	TokenModifierDeprecated                           = 0x10
	TokenModifierAbstract                             = 0x20
	TokenModifierAsync                                = 0x40
	TokenModifierModification                         = 0x80
	TokenModifierDocumentation                        = 0x100
	TokenModifierDefaultLibrary                       = 0x200
)

Variables

View Source
var SemanticTokenModifiersLegend = []string{
	"declaration",
	"definition",
	"readonly",
	"static",
	"deprecated",
	"abstract",
	"async",
	"modification",
	"documentation",
	"defaultLibrary",
}
View Source
var SemanticTokenTypesLegend = []string{
	"namespace",
	"type",
	"class",
	"enum",
	"interface",
	"struct",
	"typeParameter",
	"parameter",
	"variable",
	"property",
	"enumMember",
	"event",
	"function",
	"method",
	"macro",
	"keyword",
	"modifier",
	"comment",
	"string",
	"number",
	"regexp",
	"operator",
	"decorator",
}

Functions

This section is empty.

Types

type CChar

type CChar struct {
	Value rune
}

func (CChar) AppendBytecode

func (c CChar) AppendBytecode(stackKind bytecode.StackKind, loc Location, ops []bytecode.Op, locations []bytecode.Location, binary *bytecode.Binary, hash *bytecode.BinaryHash) ([]bytecode.Op, []bytecode.Location)

func (CChar) Code

func (c CChar) Code(currentModule QualifiedIdentifier) string

func (CChar) EqualsTo

func (c CChar) EqualsTo(o ConstValue) bool

type CFloat

type CFloat struct {
	Value float64
}

func (CFloat) AppendBytecode

func (c CFloat) AppendBytecode(stackKind bytecode.StackKind, loc Location, ops []bytecode.Op, locations []bytecode.Location, binary *bytecode.Binary, hash *bytecode.BinaryHash) ([]bytecode.Op, []bytecode.Location)

func (CFloat) Code

func (c CFloat) Code(currentModule QualifiedIdentifier) string

func (CFloat) EqualsTo

func (c CFloat) EqualsTo(o ConstValue) bool

type CInt

type CInt struct {
	Value int64
}

func (CInt) AppendBytecode

func (c CInt) AppendBytecode(stackKind bytecode.StackKind, loc Location, ops []bytecode.Op, locations []bytecode.Location, binary *bytecode.Binary, hash *bytecode.BinaryHash) ([]bytecode.Op, []bytecode.Location)

func (CInt) Code

func (c CInt) Code(currentModule QualifiedIdentifier) string

func (CInt) EqualsTo

func (c CInt) EqualsTo(o ConstValue) bool

type CString

type CString struct {
	Value string
}

func (CString) AppendBytecode

func (c CString) AppendBytecode(stackKind bytecode.StackKind, loc Location, ops []bytecode.Op, locations []bytecode.Location, binary *bytecode.Binary, hash *bytecode.BinaryHash) ([]bytecode.Op, []bytecode.Location)

func (CString) Code

func (c CString) Code(currentModule QualifiedIdentifier) string

func (CString) EqualsTo

func (c CString) EqualsTo(o ConstValue) bool

type CUnit

type CUnit struct {
}

func (CUnit) AppendBytecode

func (c CUnit) AppendBytecode(stackKind bytecode.StackKind, loc Location, ops []bytecode.Op, locations []bytecode.Location, binary *bytecode.Binary, hash *bytecode.BinaryHash) ([]bytecode.Op, []bytecode.Location)

func (CUnit) Code

func (c CUnit) Code(currentModule QualifiedIdentifier) string

func (CUnit) EqualsTo

func (c CUnit) EqualsTo(o ConstValue) bool

type Coder

type Coder interface {
	Code(currentModule QualifiedIdentifier) string
}

type ConstValue

type ConstValue interface {
	Coder
	EqualsTo(o ConstValue) bool
	AppendBytecode(stackKind bytecode.StackKind, loc Location, ops []bytecode.Op, locations []bytecode.Location, binary *bytecode.Binary, hash *bytecode.BinaryHash) ([]bytecode.Op, []bytecode.Location)
}

type DataOptionIdentifier

type DataOptionIdentifier string

type FullIdentifier

type FullIdentifier string

func (FullIdentifier) Module

type FullIdentifiers

type FullIdentifiers []FullIdentifier

func (FullIdentifiers) Join

func (fx FullIdentifiers) Join(sep string) string

type Identifier

type Identifier string

type InfixIdentifier

type InfixIdentifier string

type Location

type Location struct {
	// contains filtered or unexported fields
}

func NewLocation

func NewLocation(filePath string, content []rune, start uint32, end uint32) Location

func NewLocationCursor

func NewLocationCursor(filePath string, content []rune, start uint32) Location

func NewLocationSrc

func NewLocationSrc(filePath string, content []rune, line uint32, column uint32) Location

func (Location) Bytecode

func (loc Location) Bytecode() bytecode.Location

func (Location) Contains

func (loc Location) Contains(cursor Location) bool

func (Location) CursorString

func (loc Location) CursorString() string

func (Location) End

func (loc Location) End() uint32

func (Location) EqualsTo

func (loc Location) EqualsTo(other Location) bool

func (Location) FileContent

func (loc Location) FileContent() []rune

func (Location) FilePath

func (loc Location) FilePath() string

func (Location) GetLineAndColumn

func (loc Location) GetLineAndColumn() (startLine, startColumn, endLine, endColumn int)

func (Location) IsEmpty

func (loc Location) IsEmpty() bool

func (Location) Size

func (loc Location) Size() uint32

func (Location) Start

func (loc Location) Start() uint32

func (Location) Text

func (loc Location) Text() string

func (Location) ToToken

func (loc Location) ToToken(type_ SemanticTokenType, modifiers ...SemanticTokenModifier) SemanticToken

type PackageIdentifier

type PackageIdentifier string

type QualifiedIdentifier

type QualifiedIdentifier string

type SemanticToken

type SemanticToken struct {
	Line, Char, Length uint32
	Type               SemanticTokenType
	Modifiers          SemanticTokenModifier
}

type SemanticTokenModifier

type SemanticTokenModifier uint32

type SemanticTokenType

type SemanticTokenType uint32
const (
	TokenTypeNamespace SemanticTokenType = iota
	TokenTypeType
	TokenTypeClass
	TokenTypeEnum
	TokenTypeInterface
	TokenTypeStruct
	TokenTypeTypeParameter
	TokenTypeParameter
	TokenTypeVariable
	TokenTypeProperty
	TokenTypeEnumMember
	TokenTypeEvent
	TokenTypeFunction
	TokenTypeMethod
	TokenTypeMacro
	TokenTypeKeyword
	TokenTypeModifier
	TokenTypeComment
	TokenTypeString
	TokenTypeNumber
	TokenTypeRegexp
	TokenTypeOperator
	TokenTypeDecorator
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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