@staticmethod
def get_state(block):
    """
        Gets the user state, generally used for syntax highlighting.
        :param block: block to access
        :return: The block state

        """
    if block is None:
        return -1
    state = block.userState()
    if state == -1:
        return state
    return state & 65535
