Open
Description
Describe the bug
The FEEL engine fails to parse a nested for-loop expression:
context merge(
for entry in
for kvPair in (for kvPair in split(rawContent, "\n") return kvPair) return split(kvPair, "=")
return
context put({}, entry[1], entry[2])
)
If I wrap the nested for-loop inside parenthesis, the FEEL engine can parse the expression:
context merge(
for entry in
(for kvPair in (for kvPair in split(rawContent, "\n") return kvPair) return split(kvPair, "="))
return
context put({}, entry[1], entry[2])
)
To Reproduce
Steps to reproduce the behavior:
- Parse the expression above (Playground)
- Verify that the expression can't be parsed
failed to parse expression 'context merge(
for entry in
for kvPair in (for kvPair in split(rawContent, "\n") return kvPair) return split(kvPair, "=")
return
context put({}, entry[1], entry[2])
)': Expected (binaryComparison | between | instanceOf | in | "and" | "or" | end-of-input):1:9, found "merge(\n f"
Expected behavior
I can parse a nested for-loop without adding parenthesis.
Environment
- FEEL engine version:
1.18.1
- Affects:
- Camunda Automation Platform 7: [7.x]
- Zeebe broker: [0.x]