โ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"],
_ => []
}