sevki.org/build/ast

Package ast defines build data structures.

Index

Package Files

ast.go

Variables

var (
    InterfaceConversionError = errors.New("Interface conversion error")
)

type Assignment

type Assignment struct {
    Key   string
    Value interface{}
    Node
}

Assignment

type BasicLit

type BasicLit struct {
    Kind  token.Type // token.INT, token.FLOAT or token.STRING
    Value string     // literal string; e.g. 42, 0x7f, 3.14, 1e-9, 2.4i, 'a', '\x7f', "foo" or `\m\n\o`
    Node
}

A BasicLit node represents a literal of basic type.

func NewBasicLit

func NewBasicLit(t token.Token) *BasicLit

func (BasicLit) Interface

func (b BasicLit) Interface() interface{}

type Decl

type Decl interface {
    // contains filtered or unexported methods
}

type Error

type Error struct {
    Error error
}

type Func

type Func struct {
    Name       string
    Params     map[string]interface{}
    AnonParams []interface{}
    Parent     *Func `json:"-"`
    Node
}

Func represents a function in the ast mostly in the form of

glob("", exclude=[], exclude_directories=1)

a function can have named and anonymouse variables at the same time.

type Loop

type Loop struct {
    Func  *Func
    Range interface{}
    Key   string
    Node
}

type Map

type Map struct {
    Map map[string]interface{}
    Node
}

type Node

type Node struct {
    File       string
    Start, End Position
}

Node defines objects on file

func (*Node) SetEnd

func (n *Node) SetEnd(t token.Token)

Sets the end position of the node with a token

func (*Node) SetStart

func (n *Node) SetStart(t token.Token)

Sets the start position of the node with a token

type Position

type Position struct {
    Line, Index int
}

Position represents a index of a byte in a given file relative to the start of the line.

abcd
efg

Given "testfile.txt" 'f' would be adressed "testfile.txt:1:1"

type Slice

type Slice struct {
    Slice []interface{}
    Node
}

type Variable

type Variable struct {
    Key string
    Node
}

Variable type points to a variable in, or a loaded document.

Subdirectories