FunctionProtocol
public protocol FunctionProtocol
Functions can process values in given DataTypes, allowing the expressions to be feature-rich
-
Functions use similar conversion methods as
DataTypes. If they returnnil, the function does not apply to the given input. Otherwise, the result is expressed as an instance of a givenDataTypeIt uses the interpreter the and parsing context to be able to effectively process the contentDeclaration
Swift
func convert(input: String, interpreter: TypedInterpreter, context: Context, connectedRanges: [ClosedRange<String.Index>]) -> Any?Parameters
inputThe input to convert as a
DataTypevalueinterpreterAn interpreter instance if the content needs any further evaluation
contextThe context - if vaiables need any contextual information
connectedRangesRanges of string indices that are connected with opening-closing tag pairs, respectively
Return Value
A valid value of any
DataTypeornilif it cannot be processed
View on GitHub
Install in Dash
FunctionProtocol Protocol Reference