import "github.com/qlova/script"
bool.go collection.go float.go for.go functions.go go.go if.go int.go language.go lists.go loops.go main.go native.go print.go script.go string.go structures.go tables.go types.go value.go var.go
const ( Equals = "==" LessThan = "<" MoreThan = ">" LessThanEquals = "<=" MoreThanEquals = ">=" Plus1 = "++" Minus1 = "--" PlusEquals = "+=" MinusEquals = "-=" OverEquals = "/=" LeftOverEquals = "%=" TimesEquals = "*=" )
For loop constants.
AnyBool is anything that can retrieve a script.Bool.
AnyString needs to return a String from this package.
BoolFromCtx implements AnyBool.
type Collection interface { Value Make(Ctx, Collection, ...int) }
Collection is a collection value.
Ctx is the script ctx.
DefineFunc defines a new function from a *func(...) ...
DefineStruct defines a type with the included methods given a metatype. Takes an optional reciever name.
func (q Ctx) Equals(other Int) ForLoopCondition
func (q Ctx) EqualsL(other int) ForLoopCondition
func (q Ctx) For(set Int, condition ForLoopCondition, action ForLoopAction, f func(Int))
For is a traditional for loop.
func (q Ctx) ForL(set int, condition ForLoopCondition, action ForLoopAction, f func(Int))
ForL is the literal version of For.
func (q Ctx) If(condition AnyBool, f func()) *ElseIfChain
func (q Ctx) IfL(condition bool, f func()) *ElseIfChain
Int returns a new Int from a Go int.
IntList returns a new array of ints from given Ints.
IntListL returns a new array of ints from given literal elements.
IntTable returns a new table of ints from given Ints.
IntTableL returns a new table of ints from given literal elements.
func (q Ctx) LeftOverEquals(other Int) ForLoopAction
LeftOverEquals forloop action %=
func (q Ctx) LeftOverEqualsL(other int) ForLoopAction
LeftOverEqualsL is the literal version of LeftOverEquals.
func (q Ctx) LessThan(other Int) ForLoopCondition
func (q Ctx) LessThanEquals(other Int) ForLoopCondition
func (q Ctx) LessThanEqualsL(other int) ForLoopCondition
func (q Ctx) LessThanL(other int) ForLoopCondition
LessThanL is the literal version of LessThan.
Literal returns the script value of the given Go value.
Main is the entrypoint to the script.
func (q Ctx) Make(collection Collection, sizes ...int)
Make makes a structured type.
func (q Ctx) Minus1() ForLoopAction
func (q Ctx) MinusEquals(other Int) ForLoopAction
MinusEquals forloop action -=
func (q Ctx) MinusEqualsL(other int) ForLoopAction
MinusEqualsL is the literal version of MinusEquals.
func (q Ctx) MoreThan(other Int) ForLoopCondition
func (q Ctx) MoreThanEquals(other Int) ForLoopCondition
func (q Ctx) MoreThanEqualsL(other int) ForLoopCondition
func (q Ctx) MoreThanL(other int) ForLoopCondition
New initialises an empty script.Type derived value.
func (q Ctx) OverEquals(other Int) ForLoopAction
OverEquals forloop action /=
func (q Ctx) OverEqualsL(other int) ForLoopAction
OverEqualsL is the literal version of OverEquals.
func (q Ctx) Plus1() ForLoopAction
func (q Ctx) PlusEquals(other Int) ForLoopAction
PlusEquals forloop action +=
func (q Ctx) PlusEqualsL(other int) ForLoopAction
PlusEqualsL is the literal version of PlusEquals.
Print prints values to Stdout.
PrintL prints literal values to Stdout.
Set sets a value 'a' to be set to value 'b'.
func (q Ctx) TimesEquals(other Int) ForLoopAction
TimesEquals forloop action *=
func (q Ctx) TimesEqualsL(other int) ForLoopAction
TimesEqualsL is the literal version of TimesEquals.
Var returns a variable with optional name.
func (chain *ElseIfChain) Else(f func()) ElseIfEnder
func (chain *ElseIfChain) ElseIf(condition Bool, f func()) *ElseIfChain
func (chain *ElseIfChain) ElseIfL(condition bool, f func()) *ElseIfChain
func (chain *ElseIfChain) End()
type ElseIfEnder struct { ElseIfChain ElseIfChain Else func() }
func (ender ElseIfEnder) End()
Float is a floating-point number
Int is the default integer type for the language.
Set sets the integer.
Setc sets the integer.
IntList is an array of ints.
IndexL returns the value at the given literal index in the list.
MutateL mutates the list with literal values.
type IntTable struct { Table L map[String]Int Set func(IntTable) Lookup func(String) Int Insert func(String, Int) }
IntTable is a table of ints.
InsertL mutates the list with literal values.
LookupL returns the value at the given literal index in the list.
type Language interface { io.Writer Raw(Value) string Main(func()) Print(Values) If(If, []If, func()) //Types DefineStruct(Struct) //Structures Field(Value, string) Result //Methods RunMethod(Value, string, []Value) CallMethod(Value, string, []Value) Result //Variables DefineVariable(string, Value) Result Set(Value, Value) //Lists Index(Value, Int) Result Mutate(Value, Int, Value) //Tables Lookup(Value, String) Result Insert(Value, String, Value) //Loops. For(set Int, condition ForLoopCondition, action ForLoopAction, f func(Int)) While(Bool, func()) Loop(func()) Break() //Functions DefineFunction(Function) RunFunction(name string, args []Value) CallFunction(name string, args []Value) Result Argument(name string, index int) Result Return(Value) Plus(Int, Int) Int Same(Int, Int) Bool Not(Bool) Bool Join(String, String) String }
Language is a script language implementation.
List type.
func (*List) Make(q Ctx, collection Collection, sizes ...int)
Make makes a list.
Native is a host native type.
type Result *func() interface{}
Script is a script.
String is a unicode string.
StringFromCtx implements AnyString.
Table type.
func (*Table) Make(q Ctx, collection Collection, sizes ...int)
Make makes a table.
Runtime retrieved the runtime values.
Path | Synopsis |
---|---|
language | |
runtime |
Package script imports 5 packages (graph) and is imported by 4 packages. Updated 2020-03-02. Refresh now. Tools for package owners.