def parse_file(cc, filename):
    """
    This function actually parses the test. It does so using some pretty simple
    logic. Consequentially, you can't deviate too much from the expected format.
    Specifically we assume:

     - The start of the tutorial block (i.e., "<comment_char>TUTORIAL") is the
       first non-whitespace token on the line.
     - The start of a skipping directive (i.e.,
       "<comment_char>TUTORIAL_START_SKIP") is the first non-whitespace token on
       the line.
     - The end of a skipping directive (i.e.,
       "<comment_char>TUTORIAL_STOP_SKIP") is the first non-whitespace token on
       the line.
       C++ is the first non-whitespace token on the line.
     - all comment blocks are continuous (no blank lines in the middle)

    :param cc: The character denoting the comment
    :param filename: The full path to the file
    :return: A list of tutorial comments and code blocks
    """

    # These are parsing strings we'll need to look for
    tutor_start = cc + "TUTORIAL"
    tutor_skip_start = cc + "TUTORIAL_START_SKIP"
    tutor_skip_stop = cc + "TUTORIAL_STOP_SKIP"

    comments = []  # Will be the comments we find
    code = []  # Will be the code snippets we fine
    in_comment = False  # True signals we are in a tutorial comment block
    skipping = False
    which_first = None

    with open(filename, 'r') as input_file:
        for line in input_file:
            no_ws = line.lstrip()  # The line w/o proceeding whitespace

            # Dispatch conditions
            is_skip_start = tutor_skip_start == no_ws[:len(tutor_skip_start)]
            is_skip_stop = tutor_skip_stop == no_ws[:len(tutor_skip_stop)]
            is_tutor_start = tutor_start == no_ws[:len(tutor_start)]
            is_comment = cc == line.lstrip()[:len(cc)]

            # Actually do the dispatching
            if skipping:  # Currently skipping
                if is_skip_stop:  # and we were told to stop
                    skipping = False
            elif is_skip_stop:  # Not skipping, but told to stop
                raise Exception("TUTORIAL_STOP_SKIP w/o TUTORIAL_START_SKIP")
            elif is_skip_start:  # Told to start skipping
                skipping = True
            elif is_tutor_start:  # Told to start tutorial comment
                if which_first is None:
                    which_first = True
                if in_comment:
                    raise Exception("Can't nest TUTORIAL sections")
                comments.append([])  # Start a new comment block
                in_comment = True
            elif is_comment and in_comment:  # Part of tutorial comment
                comments[-1].append(no_ws[len(cc):])  # omit comment character
            elif in_comment:  # 1st line outside a comment block
                in_comment = False
                code.append([])
                code[-1].append(line)
            else:  # n-th line outside a comment block
                if which_first is None:
                    which_first = False
                if len(code) == 0: # If code came first, there's no array yet
                    code.append([])
                code[-1].append(line)

    return comments, code, which_first