def parse_string_literal(data, index):
    """parses the string literal whose first double quote starts at index,
    returning (strilit, new_index) where strlit is the string literal
    including the starting and trailing double quote if there is one.
    new_index points to the char after the end of the string literal"""
    if index >= len(data):
        raise EOFError(
          f'Found EOF while scanning for string literal at {index}')
    if data[index] != 0x22:
        raise EOFError(f'Found {data[index]} at {index}, expected 0x22')
    index = index + 1

    # Extract all of the tokens from the line
    strlit = b'"'
    while index < len(data) and data[index] != 0x00 and data[index] != 0x22:
        strlit += bytes((data[index],))
        index = index + 1

    if index >= len(data):
        raise EOFError(
          f'Found EOF while scanning for end of string literal at {index}')
    if data[index] == 0x00:
        return strlit, index
    strlit += b'"'
    return strlit, index + 1