astnode

package
v0.0.0-...-de9fdfd Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendFlags

type AppendFlags []string

func (*AppendFlags) Append

func (a *AppendFlags) Append(flags ...string)

func (*AppendFlags) Contains

func (a *AppendFlags) Contains(flag string) bool

type ForValue

type ForValue struct {
	Iterator *Node `yaml:"iterator,omitempty"`
	Value    *Node `yaml:"value"`
}

type Node

type Node struct {
	Type NodeType `yaml:"type"`
	Kind string   `yaml:"kind,omitempty"`

	Content       string `yaml:"content,omitempty"`
	Value         any    `yaml:"value,omitempty"`
	ValueType     *Node  `yaml:"value_type,omitempty"`
	FallbackValue *Node  `yaml:"fallback_value,omitempty"`

	IsReference bool `yaml:"is_reference,omitempty"`

	Children    []*Node `yaml:"children,omitempty"`
	Args        []*Node `yaml:"args,omitempty"`
	Body        []*Node `yaml:"body,omitempty"`
	ArrayAccess []*Node `yaml:"array_access,omitempty"`

	Attrs map[string]any `yaml:"attrs,omitempty"`
	Flags AppendFlags    `yaml:"flags,omitempty"`

	Debug *debug.Debug `yaml:"-"`
}

type NodeType

type NodeType string
const (
	NodeTypeImport  NodeType = "import"
	NodeTypeInclude NodeType = "include"

	NodeTypeFunction         NodeType = "function"
	NodeTypeInlineFunction   NodeType = "inline_function"
	NodeTypeFunctionArgument NodeType = "function_argument"
	NodeTypeFunctionCall     NodeType = "function_call"
	NodeTypeReturn           NodeType = "return"

	NodeTypeType        NodeType = "type"
	NodeTypeStruct      NodeType = "struct"
	NodeTypeStructField NodeType = "struct_field"
	NodeTypeImpl        NodeType = "impl"

	NodeTypeEvent         NodeType = "event"
	NodeTypeEventArgument NodeType = "event_argument"
	NodeTypeSubscribe     NodeType = "subscribe"
	NodeTypePublish       NodeType = "publish"

	NodeTypeExpression NodeType = "expression"
	NodeTypeOperator   NodeType = "operator"
	NodeTypeValue      NodeType = "value"

	NodeTypeIncrement NodeType = "increment"
	NodeTypeDecrement NodeType = "decrement"
	NodeTypeAssign    NodeType = "assign"

	NodeTypeVariableDecl NodeType = "variable_decl"

	NodeTypeElement            NodeType = "element"
	NodeTypeElementRawText     NodeType = "element_raw_text"
	NodeTypeElementAttribute   NodeType = "element_attribute"
	NodeTypeElementDynamicText NodeType = "element_dynamic_text"

	NodeTypeList      NodeType = "list"
	NodeTypeDict      NodeType = "dict"
	NodeTypeDictField NodeType = "dict_field"

	NodeTypeWhile  NodeType = "while"
	NodeTypeIf     NodeType = "if"
	NodeTypeElse   NodeType = "else"
	NodeTypeFor    NodeType = "for"
	NodeTypeSignal NodeType = "signal"
	NodeTypeTry    NodeType = "try"

	NodeTypeTemplateLiteral NodeType = "template_literal"
	NodeTypeRawText         NodeType = "raw_text"
	NodeTypeDynamicText     NodeType = "dynamic_text"

	NodeTypeDefer NodeType = "defer"
)

Jump to

Keyboard shortcuts

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