fixed get_precedence in the C extension