Syntax Error - Am I Going Crazy?

I might have just lost my marbles, but I keep getting a syntax error thrown at me, specifically with this expression, which I believe is of correct syntax. Is my computer being wacky, or is it me ?

# Mark regions for boundary conditions 
om = Expression("x[0] > XMAX - eps ? 1. : 0.", XMAX=XMAX, eps=eps, element = Q.ufl_element())

Sorry for such a silly question, but I’ve been staring at my monitor for a good 15 minutes and can’t seem to detect an issue.

Can you provide a MWE? It might be something to do with your choices of XMAX, eps and Q. Or perhaps your compiler doesn’t support the ternary operator? Perhaps be explicit with parenthesis x[0] > (XMAX - eps) ?.

Hi, I ended up just shutting everything down and then it ran fine - perhaps just something weird with my compiler …