Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidVariable ¶
Types ¶
type State ¶
type State interface { Variables // GetFunction by name GetFunction(pos lexer.Position, n string) (*script.FuncDec, bool) // GetFunctions returns a list of declared functions GetFunctions() []string // SetFunction sets the current FuncDec in use, returning the previous one SetFunction(currentFunction *script.FuncDec) *script.FuncDec }
State holds the current processing state of the Script
type Variables ¶
type Variables interface { // NewScope creates a new Variables scope NewScope() Variables // EndScope closes this Variables scope and returns the previous one. // If this is the Global scope this returns this instance. EndScope() Variables // NewRootScope is like NewScope except that variable lookups are not // passed to the parent if missing from the current scope. // This is used to isolate variables inside functions NewRootScope() Variables // GlobalScope returns the global scope, usually the one returned by NewVariables() GlobalScope() Variables // Declare a variable. Declare(n string) // Set a variable. If the variable is declared in a parent scope this // will set the variable there. // returns false if the variable is undeclared. Set(n string, val interface{}) bool // Get returns the variable, checking parent scopes until it finds it. Get(string) (interface{}, bool) }
func NewVariables ¶
func NewVariables() Variables
Click to show internal directories.
Click to hide internal directories.