Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Null = otto.NullValue()
TODO bah! unhappy about exporting a special null value.
maybe otto's type conversion needs a fix?
Functions ¶
func Eval ¶
func Eval(e cwl.Expression, libs []string, data map[string]interface{}) (interface{}, error)
Eval evaluates a string which is possibly a CWL expression. If the string is not an expression, the string is returned unchanged.
func EvalParts ¶
EvalParts evaluates a string which has been parsed by Parse(). If the parts do not represent an expression, the original raw string is returned. This is a low-level function, it's better to use EvalString().
func IsExpression ¶
func IsExpression(expr cwl.Expression) bool
IsExpression returns true if the given string contains a CWL expression.
Types ¶
type Part ¶
type Part struct { Raw string Expr string Start, End int // true if the expression is a javascript function body (e.g. ${return "foo"}) IsFuncBody bool }
Part describes a part of a CWL expression string which has been parsed by Parse().
func Parse ¶
func Parse(expr cwl.Expression) []*Part
Parse parses a string into a list of parts. If the string does not contain a CWL expression, a single part is returned with `Raw` set to the original string and `Expr` set to an empty string.