FunctionProtocol
public protocol FunctionProtocol
Function
s can process values in given DataType
s, allowing the expressions to be feature-rich
-
Functions use similar conversion methods as
DataType
s. If they returnnil
, the function does not apply to the given input. Otherwise, the result is expressed as an instance of a givenDataType
It 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
input
The input to convert as a
DataType
valueinterpreter
An interpreter instance if the content needs any further evaluation
context
The context - if vaiables need any contextual information
connectedRanges
Ranges of string indices that are connected with opening-closing tag pairs, respectively
Return Value
A valid value of any
DataType
ornil
if it cannot be processed