cancel
Showing results for 
Search instead for 
Did you mean: 

Encountered Extraneous Input

Vishaal_Arun
New Contributor II

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 2

dmiller
Former Employee

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


Diane Miller

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