Documentation ¶
Overview ¶
Boolean operations and loop handling.
Index ¶
- Variables
- func Register(reg func(any))
- type Always
- type Always_Slice
- type Brancher
- type Brancher_Slot
- type Brancher_Slots
- type Break
- type Break_Slice
- type ChooseBranch
- func (op *ChooseBranch) Branch(run rt.Runtime) (err error)
- func (op *ChooseBranch) Execute(run rt.Runtime) (err error)
- func (op *ChooseBranch) GetMarkup(ensure bool) map[string]any
- func (op *ChooseBranch) PickBranch(run rt.Runtime, pushes *int) (ret []rt.Execute, err error)
- func (*ChooseBranch) TypeInfo() typeinfo.T
- type ChooseBranch_Slice
- type ChooseNothingElse
- type ChooseNothingElse_Slice
- type ChooseNum
- type ChooseNum_Slice
- type ChooseText
- type ChooseText_Slice
- type Continue
- type Continue_Slice
- type DoInterrupt
- type IsAll
- type IsAll_Slice
- type IsAny
- type IsAny_Slice
- type IsValue
- type IsValue_Slice
- type MaxLoopError
- type Never
- type Never_Slice
- type Not
- type NotAll
- type NotAll_Slice
- type NotAny
- type NotAny_Slice
- type NotValue
- type NotValue_Slice
- type Not_Slice
- type Repeat
- type Repeat_Slice
Constants ¶
This section is empty.
Variables ¶
var Z_Types = typeinfo.TypeSet{ Name: "logic", Comment: []string{ "Boolean operations and loop handling.", }, Slot: z_slot_list, Flow: z_flow_list, Signatures: z_signatures, }
package listing of type data
var Zt_Always typeinfo.Flow
always, a type of flow.
var Zt_Brancher = typeinfo.Slot{ Name: "brancher", Markup: map[string]any{ "--": "Helper for the else statements of [ChooseBranch].", }, }
brancher, a type of slot.
var Zt_Break typeinfo.Flow
break, a type of flow.
var Zt_ChooseBranch typeinfo.Flow
choose_branch, a type of flow.
var Zt_ChooseNothingElse typeinfo.Flow
choose_nothing_else, a type of flow.
var Zt_ChooseNum typeinfo.Flow
choose_num, a type of flow.
var Zt_ChooseText typeinfo.Flow
choose_text, a type of flow.
var Zt_Continue typeinfo.Flow
continue, a type of flow.
var Zt_IsAll typeinfo.Flow
is_all, a type of flow.
var Zt_IsAny typeinfo.Flow
is_any, a type of flow.
var Zt_IsValue typeinfo.Flow
is_value, a type of flow.
var Zt_Never typeinfo.Flow
never, a type of flow.
var Zt_Not typeinfo.Flow
not, a type of flow.
var Zt_NotAll typeinfo.Flow
not_all, a type of flow.
var Zt_NotAny typeinfo.Flow
not_any, a type of flow.
var Zt_NotValue typeinfo.Flow
not_value, a type of flow.
var Zt_Repeat typeinfo.Flow
repeat, a type of flow.
Functions ¶
Types ¶
type Always_Slice ¶
type Always_Slice []Always
Holds a slice of type Always.
func (*Always_Slice) Repeats ¶
func (op *Always_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Always.
func (*Always_Slice) TypeInfo ¶
func (*Always_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Always.
type Brancher_Slot ¶
type Brancher_Slot struct{ Value Brancher }
Holds a single slot.
func (*Brancher_Slot) TypeInfo ¶
func (*Brancher_Slot) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a single slot.
type Brancher_Slots ¶
type Brancher_Slots []Brancher
Holds a slice of slots.
func (*Brancher_Slots) Repeats ¶
func (op *Brancher_Slots) Repeats() bool
Implements typeinfo.Repeats for a slice of slots.
func (*Brancher_Slots) TypeInfo ¶
func (*Brancher_Slots) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of slots.
type Break ¶
In a repeating loop, exit the loop; or, in a rule, stop processing rules.
func (*Break) GetMarkup ¶
Implements typeinfo.Markup
type Break_Slice ¶
type Break_Slice []Break
Holds a slice of type Break.
func (*Break_Slice) Repeats ¶
func (op *Break_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Break.
func (*Break_Slice) TypeInfo ¶
func (*Break_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Break.
type ChooseBranch ¶
type ChooseBranch struct { Condition rtti.BoolEval Args []call.Arg Exe []rtti.Execute Else Brancher Markup map[string]any `json:",omitempty"` }
Select a block of statements to run based on a true/false check.
func PickTree ¶
func PickTree(exe []rt.Execute) (ret *ChooseBranch)
scan for an initial branching statement in a "case like" switch,. that statement indicates a filter for a rule; returns nil if no such statement exists
func (*ChooseBranch) GetMarkup ¶
func (op *ChooseBranch) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*ChooseBranch) PickBranch ¶
loop through descendant branches to find which block we should run. rationale: patterns sometimes need to update counters and *not* run the block which guard them. this makes rule processing and normal branch selection the same.
func (*ChooseBranch) TypeInfo ¶
func (*ChooseBranch) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type ChooseBranch_Slice ¶
type ChooseBranch_Slice []ChooseBranch
Holds a slice of type ChooseBranch.
func (*ChooseBranch_Slice) Repeats ¶
func (op *ChooseBranch_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ChooseBranch.
func (*ChooseBranch_Slice) TypeInfo ¶
func (*ChooseBranch_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ChooseBranch.
type ChooseNothingElse ¶
Run a set of statements after a condition has failed.
func (*ChooseNothingElse) Branch ¶
func (op *ChooseNothingElse) Branch(run rt.Runtime) (err error)
else statements can only be run in the context of previous decisions ( include things like the branch of an empty while statements )
func (*ChooseNothingElse) GetMarkup ¶
func (op *ChooseNothingElse) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*ChooseNothingElse) TypeInfo ¶
func (*ChooseNothingElse) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type ChooseNothingElse_Slice ¶
type ChooseNothingElse_Slice []ChooseNothingElse
Holds a slice of type ChooseNothingElse.
func (*ChooseNothingElse_Slice) Repeats ¶
func (op *ChooseNothingElse_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ChooseNothingElse.
func (*ChooseNothingElse_Slice) TypeInfo ¶
func (*ChooseNothingElse_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ChooseNothingElse.
type ChooseNum ¶
type ChooseNum struct { If rtti.BoolEval Args []call.Arg True rtti.NumEval False rtti.NumEval Markup map[string]any `json:",omitempty"` }
Pick one of two possible text values based on a condition. ( This acts similar to a ternary. )
func (*ChooseNum) GetMarkup ¶
Implements typeinfo.Markup
type ChooseNum_Slice ¶
type ChooseNum_Slice []ChooseNum
Holds a slice of type ChooseNum.
func (*ChooseNum_Slice) Repeats ¶
func (op *ChooseNum_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ChooseNum.
func (*ChooseNum_Slice) TypeInfo ¶
func (*ChooseNum_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ChooseNum.
type ChooseText ¶
type ChooseText struct { If rtti.BoolEval Args []call.Arg True rtti.TextEval False rtti.TextEval Markup map[string]any `json:",omitempty"` }
Pick one of two possible text values based on a condition. ( This acts similar to a ternary. )
func (*ChooseText) GetMarkup ¶
func (op *ChooseText) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
type ChooseText_Slice ¶
type ChooseText_Slice []ChooseText
Holds a slice of type ChooseText.
func (*ChooseText_Slice) Repeats ¶
func (op *ChooseText_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ChooseText.
func (*ChooseText_Slice) TypeInfo ¶
func (*ChooseText_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ChooseText.
type Continue ¶
In a repeating loop, try the next iteration of the loop; or, in a rule, continue to the next rule.
func (*Continue) GetMarkup ¶
Implements typeinfo.Markup
type Continue_Slice ¶
type Continue_Slice []Continue
Holds a slice of type Continue.
func (*Continue_Slice) Repeats ¶
func (op *Continue_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Continue.
func (*Continue_Slice) TypeInfo ¶
func (*Continue_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Continue.
type DoInterrupt ¶
type DoInterrupt struct{ KeepGoing bool }
DoInterrupt - an error code to break out of loops
func (DoInterrupt) Error ¶
func (e DoInterrupt) Error() string
func (DoInterrupt) NoPanic ¶
func (e DoInterrupt) NoPanic()
type IsAll ¶
Check that every condition in a set of conditions returns true. Stops after finding a failed condition. An empty list returns false.
func (*IsAll) GetMarkup ¶
Implements typeinfo.Markup
type IsAll_Slice ¶
type IsAll_Slice []IsAll
Holds a slice of type IsAll.
func (*IsAll_Slice) Repeats ¶
func (op *IsAll_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of IsAll.
func (*IsAll_Slice) TypeInfo ¶
func (*IsAll_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of IsAll.
type IsAny ¶
Check whether any condition in a set of conditions returns true. Stops after finding the first successful condition. An empty list returns false.
func (*IsAny) GetMarkup ¶
Implements typeinfo.Markup
type IsAny_Slice ¶
type IsAny_Slice []IsAny
Holds a slice of type IsAny.
func (*IsAny_Slice) Repeats ¶
func (op *IsAny_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of IsAny.
func (*IsAny_Slice) TypeInfo ¶
func (*IsAny_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of IsAny.
type IsValue ¶
type IsValue struct { Value rtti.Assignment Markup map[string]any `json:",omitempty"` }
Determine the "truthiness" of a value. Bool values simply return their value. Num values: are true when not exactly zero. Text values: are true whenever they contain content. List values: are true whenever the list is non-empty. ( note this is similar to python, and different than javascript. ) Record values: are true whenever they have been initialized. ( only sub-records start uninitialized; record variables are always true. )
func (*IsValue) GetMarkup ¶
Implements typeinfo.Markup
type IsValue_Slice ¶
type IsValue_Slice []IsValue
Holds a slice of type IsValue.
func (*IsValue_Slice) Repeats ¶
func (op *IsValue_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of IsValue.
func (*IsValue_Slice) TypeInfo ¶
func (*IsValue_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of IsValue.
type MaxLoopError ¶
type MaxLoopError int
MaxLoopError provides both an error and a counter
var MaxLoopIterations MaxLoopError = 0xbad
func (MaxLoopError) Error ¶
func (e MaxLoopError) Error() string
type Never_Slice ¶
type Never_Slice []Never
Holds a slice of type Never.
func (*Never_Slice) Repeats ¶
func (op *Never_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Never.
func (*Never_Slice) TypeInfo ¶
func (*Never_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Never.
type Not ¶
Determine the opposite of a condition.
func (*Not) GetMarkup ¶
Implements typeinfo.Markup
type NotAll ¶
Check that every condition in a set of conditions returns false. Stops after finding any successful condition. An empty list returns false.
func (*NotAll) GetMarkup ¶
Implements typeinfo.Markup
type NotAll_Slice ¶
type NotAll_Slice []NotAll
Holds a slice of type NotAll.
func (*NotAll_Slice) Repeats ¶
func (op *NotAll_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of NotAll.
func (*NotAll_Slice) TypeInfo ¶
func (*NotAll_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of NotAll.
type NotAny ¶
Check whether any condition in a set of conditions returns false. Stops after finding any failed condition. An empty list returns false.
func (*NotAny) GetMarkup ¶
Implements typeinfo.Markup
type NotAny_Slice ¶
type NotAny_Slice []NotAny
Holds a slice of type NotAny.
func (*NotAny_Slice) Repeats ¶
func (op *NotAny_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of NotAny.
func (*NotAny_Slice) TypeInfo ¶
func (*NotAny_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of NotAny.
type NotValue ¶
type NotValue struct { Value rtti.Assignment Markup map[string]any `json:",omitempty"` }
Determine the "falsiness" of a value. This is the opposite of [TrueValue].
func (*NotValue) GetMarkup ¶
Implements typeinfo.Markup
type NotValue_Slice ¶
type NotValue_Slice []NotValue
Holds a slice of type NotValue.
func (*NotValue_Slice) Repeats ¶
func (op *NotValue_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of NotValue.
func (*NotValue_Slice) TypeInfo ¶
func (*NotValue_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of NotValue.
type Not_Slice ¶
type Not_Slice []Not
Holds a slice of type Not.
func (*Not_Slice) Repeats ¶
Implements typeinfo.Repeats for a slice of Not.
type Repeat ¶
type Repeat struct { Condition rtti.BoolEval Initial []call.Arg Args []call.Arg Exe []rtti.Execute Markup map[string]any `json:",omitempty"` }
Keep running a series of actions while a condition succeeds.
func (*Repeat) GetMarkup ¶
Implements typeinfo.Markup
type Repeat_Slice ¶
type Repeat_Slice []Repeat
Holds a slice of type Repeat.
func (*Repeat_Slice) Repeats ¶
func (op *Repeat_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Repeat.
func (*Repeat_Slice) TypeInfo ¶
func (*Repeat_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Repeat.