Documentation ¶
Index ¶
- Variables
- func Check(v rt.Value, want affine.Affinity) (err error)
- func CheckList(v rt.Value) (err error)
- func ConvertValue(run rt.Runtime, val rt.Value, out affine.Affinity) (ret rt.Value, err error)
- func EnsureField(ks rt.Kinds, rec *rt.Record, field string) (ret rt.Value, err error)
- func Falsy(v rt.Value) (ret bool)
- func FillRecord(run rt.Runtime, rec *rt.Record, keys []string, vals []rt.Value) (ret *rt.Record, err error)
- func GetAssignment(run rt.Runtime, a rt.Assignment) (ret rt.Value, err error)
- func GetBool(run rt.Runtime, eval rt.BoolEval) (ret rt.Value, err error)
- func GetFlag(run rt.Runtime, opt meta.Options) (ret bool)
- func GetNum(run rt.Runtime, eval rt.NumEval) (ret rt.Value, err error)
- func GetNumList(run rt.Runtime, eval rt.NumListEval) (ret rt.Value, err error)
- func GetOptionalBool(run rt.Runtime, eval rt.BoolEval, fallback bool) (ret rt.Value, err error)
- func GetOptionalInt(run rt.Runtime, eval rt.NumEval, fallback int) (ret int, err error)
- func GetOptionalNumber(run rt.Runtime, eval rt.NumEval, fallback float64) (ret rt.Value, err error)
- func GetOptionalNumbers(run rt.Runtime, eval rt.NumListEval, fallback []float64) (ret rt.Value, err error)
- func GetOptionalText(run rt.Runtime, eval rt.TextEval, fallback string) (ret rt.Value, err error)
- func GetOptionalTexts(run rt.Runtime, eval rt.TextListEval, fallback []string) (ret rt.Value, err error)
- func GetRecord(run rt.Runtime, eval rt.RecordEval) (ret rt.Value, err error)
- func GetRecordList(run rt.Runtime, eval rt.RecordListEval) (ret rt.Value, err error)
- func GetReference(run rt.Runtime, op rt.Address) (ret rt.Reference, err error)
- func GetTemplateText() (ret rt.Value)
- func GetText(run rt.Runtime, eval rt.TextEval) (ret rt.Value, err error)
- func GetTextList(run rt.Runtime, eval rt.TextListEval) (ret rt.Value, err error)
- func IsKindOf(run rt.Runtime, obj, kind string) (ret bool, err error)
- func ListIt(v rt.Value) (ret *sliceIt)
- func NewRecord(ks rt.Kinds, cls string) (ret *rt.Record, err error)
- func ObjectText(run rt.Runtime, eval rt.TextEval) (ret rt.Value, err error)
- func PopSeveral(run rt.Runtime, p int)
- func Range(i, min, max int) (ret int, err error)
- func RectifyText(run rt.Runtime, val rt.Value, aff affine.Affinity, cls string) (ret rt.Value, err error)
- func Run(run rt.Runtime, exe rt.Execute) (err error)
- func RunAll(run rt.Runtime, exes []rt.Execute) (err error)
- func SliceIt(size int, next func(int) (rt.Value, error)) *sliceIt
- func Truthy(v rt.Value) (ret bool)
- func WriteText(run rt.Runtime, eval rt.TextEval) (err error)
- type LabelFinder
- type MissingEval
Constants ¶
This section is empty.
Variables ¶
var HackTillTemplatesCanEvaluatePatternTypes rt.Value
fix! ( at the very least should live in pattern but we need to remove its few -- tests and Determine -- dependencies on core
Functions ¶
func ConvertValue ¶
Attempt to coerce the passed value into the passed affinity. Bool and num values can become text ( "true" or "false", or the digits as text. ) All values can become bool ( according to their truthiness. )
func EnsureField ¶
pulls a field out of this record, creating a sub-record if necessary
func FillRecord ¶
func FillRecord(run rt.Runtime, rec *rt.Record, keys []string, vals []rt.Value) (ret *rt.Record, err error)
FillRecord fill the passed record with the arguments named by keys and values keys are optional, but if they exist must match the order of fields in the record; there doesnt have to be be a key for every field; they can be sparse. if there are more values than keys, this assumes the first few values are indexed ( keys are right justified ) returns the passed record if there's no error
func GetAssignment ¶
handles null assignments by returning "MissingEval" error
func GetNum ¶ added in v0.24.6
GetNum runs the specified eval, returning an error if the eval is nil.
func GetNumList ¶
GetNumList returns an new iterator to walk the passed list, or an empty iterator if the value is null.
func GetOptionalBool ¶
GetOptionalBool runs the optionally specified eval.
func GetOptionalInt ¶ added in v0.24.8
GetOptionalInt runs the optionally specified eval.
func GetOptionalNumber ¶
GetOptionalNumber runs the optionally specified eval.
func GetOptionalNumbers ¶
func GetOptionalNumbers(run rt.Runtime, eval rt.NumListEval, fallback []float64) (ret rt.Value, err error)
GetOptionalNumber runs the optionally specified eval.
func GetOptionalText ¶
GetOptionalText runs the optionally specified eval.
func GetOptionalTexts ¶
func GetOptionalTexts(run rt.Runtime, eval rt.TextListEval, fallback []string) (ret rt.Value, err error)
GetOptionalText runs the optionally specified eval.
func GetRecordList ¶
GetRecordList returns an new iterator to walk the passed list, or an empty iterator if the value is null.
func GetReference ¶ added in v0.24.6
check that op exists and then call GetPath on it.
func GetTemplateText ¶
func GetTextList ¶
GetTextList returns an new iterator to walk the passed list, or an empty iterator if the value is null.
func ObjectText ¶
ObjectText - given an eval producing a name, return a string value of the object's id. can return a valid "empty" value for empty strings
func PopSeveral ¶
func RectifyText ¶
func RectifyText(run rt.Runtime, val rt.Value, aff affine.Affinity, cls string) (ret rt.Value, err error)
used when converting values to fields that might require objects. if the target field (ex. a pattern local) requires text of a certain type and the incoming value is untyped, try to convert it.
func Run ¶
Run executes the passed statement using the passed runtime; does *not* error if the passed exec is nil.
func RunAll ¶
Run executes the passed statement using the passed runtime; does *not* error if the passed exec is nil.
func Truthy ¶
Determine the true/false implication 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. )
Types ¶
type LabelFinder ¶
type LabelFinder struct {
// contains filtered or unexported fields
}
func NewLabelFinder ¶
type MissingEval ¶
type MissingEval string
MissingEval error type for unknown variables while processing loops.
func (MissingEval) Error ¶
func (e MissingEval) Error() string
Error returns the name of the unknown variable.