Using a match statement here might be slow, check the generated code with `javap`. It would be safer to do `if (c == '(')` and such.