Documentation ¶
Index ¶
- Variables
- func IsDigit(ch rune) bool
- func IsWhiteSpace(ch rune) bool
- func IsWordCharacter(ch rune) bool
- func SplitToken(data []byte, atEOF bool) (advance int, token []byte, err error)
- type ArrayAccess
- type ArrayExpression
- type ArrayValue
- type AssignExpression
- type BadEvaluable
- type Environment
- type Evaluable
- func ParseAsArray(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsArrayAccessOrArray(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsExp(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsFactor0(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsFactor1(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsFactor2(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsFactor3(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsFunctionCall(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsNumber(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsString(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseAsVariable(tokenizer *LookAheadScanner) (eval Evaluable, err error)
- func ParseScript(text string) (Evaluable, error)
- type FunctionCall
- type FunctionValue
- type GlobalEnvironment
- type IntValue
- type JoinedExpression
- type LookAheadScanner
- type MapValue
- type NumericOperationExpression
- type PlusExpression
- type RuneCheck
- type ScriptFunction
- type ScriptFunctionCall
- type StringSet
- func (v StringSet) Add(s string)
- func (v StringSet) AddAll(s StringSet)
- func (v StringSet) Array() []string
- func (v StringSet) Contains(s string) bool
- func (v StringSet) Intersect(x StringSet) StringSet
- func (v StringSet) MarshalJSON() ([]byte, error)
- func (v StringSet) Remove(s string)
- func (v StringSet) Size() int
- func (v *StringSet) UnmarshalJSON(data []byte) error
- type StringValue
- type SubEnvironment
- type Value
- func EvaluateScript(text string, env Environment) (Value, error)
- func ScriptFunctionCallBasename(args []Value) (Value, error)
- func ScriptFunctionCallDirname(args []Value) (Value, error)
- func ScriptFunctionCallPrefix(args []Value) (Value, error)
- func ScriptFunctionCallZip(args []Value) (Value, error)
- type ValueEvaluable
- type Variable
Constants ¶
This section is empty.
Variables ¶
View Source
var BuiltinFunctions = map[string]*ScriptFunction{ "basename": &ScriptFunction{ScriptFunctionCallBasename, "basename", 1, 2}, "dirname": &ScriptFunction{ScriptFunctionCallDirname, "dirname", 1, 1}, "prefix": &ScriptFunction{ScriptFunctionCallPrefix, "prefix", 2, 2}, "zip": &ScriptFunction{ScriptFunctionCallZip, "zip", 2, 2}, }
Functions ¶
func IsWhiteSpace ¶
func IsWordCharacter ¶
Types ¶
type ArrayAccess ¶
func (*ArrayAccess) Evaluate ¶
func (v *ArrayAccess) Evaluate(env Environment) (Value, error)
func (*ArrayAccess) String ¶
func (v *ArrayAccess) String() string
func (*ArrayAccess) SubEvaluable ¶
func (x *ArrayAccess) SubEvaluable() []Evaluable
type ArrayExpression ¶
type ArrayExpression struct {
// contains filtered or unexported fields
}
func (*ArrayExpression) Evaluate ¶
func (v *ArrayExpression) Evaluate(env Environment) (Value, error)
func (*ArrayExpression) String ¶
func (v *ArrayExpression) String() string
func (*ArrayExpression) SubEvaluable ¶
func (x *ArrayExpression) SubEvaluable() []Evaluable
type ArrayValue ¶
type ArrayValue struct {
// contains filtered or unexported fields
}
func CreateArrayValue2 ¶
func CreateArrayValue2(v1 Value, v2 Value) ArrayValue
func (ArrayValue) AsArray ¶
func (v ArrayValue) AsArray() ([]string, error)
func (ArrayValue) AsInt ¶
func (v ArrayValue) AsInt() (int64, error)
func (ArrayValue) AsRawArray ¶
func (v ArrayValue) AsRawArray() []Value
func (ArrayValue) AsString ¶
func (v ArrayValue) AsString() (string, error)
func (ArrayValue) String ¶
func (v ArrayValue) String() string
func (ArrayValue) Value ¶
func (v ArrayValue) Value() []Value
type AssignExpression ¶
type AssignExpression struct {
// contains filtered or unexported fields
}
func (*AssignExpression) Evaluate ¶
func (v *AssignExpression) Evaluate(env Environment) (Value, error)
func (*AssignExpression) String ¶
func (v *AssignExpression) String() string
func (*AssignExpression) SubEvaluable ¶
func (x *AssignExpression) SubEvaluable() []Evaluable
type BadEvaluable ¶
type BadEvaluable struct{}
func (BadEvaluable) Evaluate ¶
func (x BadEvaluable) Evaluate(env Environment) (Value, error)
func (BadEvaluable) String ¶
func (x BadEvaluable) String() string
func (BadEvaluable) SubEvaluable ¶
func (x BadEvaluable) SubEvaluable() []Evaluable
type Environment ¶
type Environment interface { // Get value of variable Value(key string) (Value, error) Assign(key string, value Value) error // Get parent environment ParentEnvironment() Environment }
Environment contains variable values
func CreateMixedEnvironment ¶
func CreateMixedEnvironment(e Environment, m map[string]Value) Environment
func CreateSubEnvironment ¶
func CreateSubEnvironment(e Environment) Environment
func NewGlobalEnvironment ¶
func NewGlobalEnvironment() Environment
type Evaluable ¶
type Evaluable interface { Evaluate(env Environment) (Value, error) String() string SubEvaluable() []Evaluable }
Evaluable is interface of evaluable blocks
func ParseAsArray ¶
func ParseAsArray(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsArrayAccessOrArray ¶
func ParseAsArrayAccessOrArray(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsExp ¶
func ParseAsExp(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsFactor0 ¶
func ParseAsFactor0(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsFactor1 ¶
func ParseAsFactor1(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsFactor2 ¶
func ParseAsFactor2(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsFactor3 ¶
func ParseAsFactor3(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsFunctionCall ¶
func ParseAsFunctionCall(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsNumber ¶
func ParseAsNumber(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsString ¶
func ParseAsString(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseAsVariable ¶
func ParseAsVariable(tokenizer *LookAheadScanner) (eval Evaluable, err error)
func ParseScript ¶
type FunctionCall ¶
type FunctionCall struct {
// contains filtered or unexported fields
}
func (*FunctionCall) Evaluate ¶
func (v *FunctionCall) Evaluate(env Environment) (Value, error)
func (*FunctionCall) String ¶
func (v *FunctionCall) String() string
func (*FunctionCall) SubEvaluable ¶
func (x *FunctionCall) SubEvaluable() []Evaluable
type FunctionValue ¶
type FunctionValue struct {
// contains filtered or unexported fields
}
func (FunctionValue) AsInt ¶
func (v FunctionValue) AsInt() (int64, error)
func (FunctionValue) AsString ¶
func (v FunctionValue) AsString() (string, error)
func (FunctionValue) String ¶
func (v FunctionValue) String() string
func (FunctionValue) Value ¶
func (v FunctionValue) Value() *ScriptFunction
type GlobalEnvironment ¶
type GlobalEnvironment struct {
// contains filtered or unexported fields
}
GlobalEnvironment is Global environment container
func (*GlobalEnvironment) Assign ¶
func (ge *GlobalEnvironment) Assign(key string, value Value) error
func (*GlobalEnvironment) ParentEnvironment ¶
func (ge *GlobalEnvironment) ParentEnvironment() Environment
type IntValue ¶
type IntValue struct {
// contains filtered or unexported fields
}
func NewIntValue ¶
type JoinedExpression ¶
type JoinedExpression struct {
// contains filtered or unexported fields
}
func (*JoinedExpression) Evaluate ¶
func (v *JoinedExpression) Evaluate(env Environment) (Value, error)
func (*JoinedExpression) String ¶
func (v *JoinedExpression) String() string
func (*JoinedExpression) SubEvaluable ¶
func (x *JoinedExpression) SubEvaluable() []Evaluable
type LookAheadScanner ¶
type LookAheadScanner struct {
// contains filtered or unexported fields
}
func NewLookAheadScanner ¶
func NewLookAheadScanner(scanner *bufio.Scanner) *LookAheadScanner
func NewTokenizer ¶
func NewTokenizer(r io.Reader) *LookAheadScanner
func NewTokenizerFromText ¶
func NewTokenizerFromText(text string) *LookAheadScanner
func (*LookAheadScanner) Bytes ¶
func (s *LookAheadScanner) Bytes() []byte
func (*LookAheadScanner) Err ¶
func (s *LookAheadScanner) Err() error
func (*LookAheadScanner) LookAheadBytes ¶
func (s *LookAheadScanner) LookAheadBytes(i int) []byte
func (*LookAheadScanner) LookAheadText ¶
func (s *LookAheadScanner) LookAheadText(i int) string
func (*LookAheadScanner) Scan ¶
func (s *LookAheadScanner) Scan() bool
func (*LookAheadScanner) Text ¶
func (s *LookAheadScanner) Text() string
type NumericOperationExpression ¶
type NumericOperationExpression struct {
// contains filtered or unexported fields
}
func (*NumericOperationExpression) Evaluate ¶
func (v *NumericOperationExpression) Evaluate(env Environment) (Value, error)
func (*NumericOperationExpression) String ¶
func (v *NumericOperationExpression) String() string
func (*NumericOperationExpression) SubEvaluable ¶
func (x *NumericOperationExpression) SubEvaluable() []Evaluable
type PlusExpression ¶
type PlusExpression struct {
// contains filtered or unexported fields
}
func (*PlusExpression) Evaluate ¶
func (v *PlusExpression) Evaluate(env Environment) (Value, error)
func (*PlusExpression) String ¶
func (v *PlusExpression) String() string
func (*PlusExpression) SubEvaluable ¶
func (x *PlusExpression) SubEvaluable() []Evaluable
type ScriptFunction ¶
type ScriptFunction struct {
// contains filtered or unexported fields
}
func (ScriptFunction) String ¶
func (s ScriptFunction) String() string
type ScriptFunctionCall ¶
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
func NewStringSet ¶
func NewStringSet() StringSet
func NewStringSetWithValues ¶
func SearchCreatedVariables ¶
func (StringSet) MarshalJSON ¶
func (*StringSet) UnmarshalJSON ¶
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
func NewStringValue ¶
func NewStringValue(str string) StringValue
func (StringValue) AsInt ¶
func (v StringValue) AsInt() (int64, error)
func (StringValue) AsString ¶
func (v StringValue) AsString() (string, error)
func (StringValue) String ¶
func (v StringValue) String() string
func (StringValue) Value ¶
func (v StringValue) Value() string
type SubEnvironment ¶
type SubEnvironment struct {
// contains filtered or unexported fields
}
func (*SubEnvironment) ParentEnvironment ¶
func (se *SubEnvironment) ParentEnvironment() Environment
type Value ¶
type Value interface { // String representation of value for debug String() string // Convert to string to embed AsString() (string, error) // Convert to int AsInt() (int64, error) }
Value representation in flowscript
func EvaluateScript ¶
func EvaluateScript(text string, env Environment) (Value, error)
func ScriptFunctionCallZip ¶
type ValueEvaluable ¶
type ValueEvaluable struct {
// contains filtered or unexported fields
}
func (ValueEvaluable) Evaluate ¶
func (x ValueEvaluable) Evaluate(env Environment) (Value, error)
func (ValueEvaluable) String ¶
func (x ValueEvaluable) String() string
func (ValueEvaluable) SubEvaluable ¶
func (x ValueEvaluable) SubEvaluable() []Evaluable
Click to show internal directories.
Click to hide internal directories.