convoworks-core
convoworks-core copied to clipboard
Expression parser is not able to handle associative arrays inside expression
While evaluating strings, EvalContext:_extractExpressions() has to parse out all expressions which are defined with ${}. As the PHP associative array syntax uses curly brackets too, current parsing mechanism is not able to handle it right,
Example:
indexed array is OK ${count(['a', 'b'])}
associative array will fail ${count({'a'=>'option', 'b'=>'other option'})}
Requirements:
- add unit test which will test associative array parsing (and will fail currently)
- improve parsing to support use of associative arrays
Side note:
It seems like this functionality might be migrated to the https://github.com/zef-dev/zef-expression-language library