I think there is a way, but I’m not sure it’s really feasible.
One example of what you describe is the adjoint
function and the '
postfix operator
https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Base.adjoint
Based on this post, the infix/postfix/… operators are detected in the parser. Looks like trans-op
/ctrans-op
refers to the adjoint mentioned above.
So, in principle, one could add more individual rules to parse the code and recognize postfix operators, but since x⁻¹
is otherwise just a normal variable name, I don’t think there is a way without hacking the parser…