def extract_projection_variable(tree_part):
    """
    If the tree_part passed has a 'projection' section, a list containing every variable is returned. If there
    is no 'projection' section an empty list is returned instead.

    :tree_part: parseResult checked
    :returns: a list containing every retrieved variable in the checked tree_part
    """

    if "projection" in tree_part:
        # Projection variable extraction
        return [variable.var for variable in tree_part.projection]
    return []