04-14-2023 04:18 AM
Hi all,
I got the Extraneous input error when i compiled the below expression in Mapper,
_perm == 'F'? ["R", "W", "X"]:(_perm=='RW'?["R", "W"]:(_perm=='RE'?["R", "X"]:(_perm=='R'?["R"]:[ ]))): []
Error:
Could not compile expression: (_perm == ‘F’ ? [“R”, “W”, “X” … (Reason: Encountered extraneous input ‘:’ at line 1:108; expecting={‘||’, ‘&&’, ‘^’, ‘==’, ‘!=’, ‘>’, ‘<’, ‘>=’, ‘<=’, ‘+’, ‘-’, ‘*’, ‘/’, ‘%’, ‘instanceof’, ‘in’, ‘[’, ‘(’, ‘)’, ‘.’, PropertyRef}; Resolution: Please check expression syntax)
Please help me to sort it out.
Thanks in Advance!!!
04-14-2023 05:08 PM
(I placed your expression in code format so the square braces didn’t just make a checkbox)
04-15-2023 05:25 AM
That’s a little bit much for me to troubleshoot. I even get a different error, so the interpreter may be having trouble with it too.
For readability, you might prefer the match operator :
match _perm {
'F' => ["R","W","X"],
'RW' => ["R","W"],
'RE' => ["R","X"],
'R' => ["R"],
_ => []
}