Forum Discussion

Vishaal_Arun's avatar
Vishaal_Arun
New Contributor II
3 years ago

Encountered Extraneous Input

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!!!

2 Replies

  • dmiller's avatar
    dmiller
    Former Employee

    (I placed your expression in code format so the square braces didn’t just make a checkbox)

  • del's avatar
    del
    Contributor III

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