Parse each `menuentry` that the grub v2 configuration contains
    * Uses "_parse_script" to eliminate bash scripts

def _parse_menu_entry(line_iter, cur_line, conf):
    """
    Parse each `menuentry` that the grub v2 configuration contains
    * Uses "_parse_script" to eliminate bash scripts
    """
    menu = []
    conf['menuentry'].append(menu)
    n, entry = _parse_line("menuentry", cur_line)

    entry_name, v = _parse_line("{", entry)
    if not entry_name:
        raise Exception("Cannot parse menuentry line: {0}".format(cur_line))

    menu.append(('menuentry_name', entry_name))
    if v:
        menu.append(_parse_cmd(v))

    while (True):
        line = next(line_iter)
        if "{" in line:
            n, v = _parse_line("{", line)
            if v:
                menu.append(_parse_cmd(v))
        elif "}" in line:
            n, v = _parse_line("}", line)
            if n:
                menu.append(_parse_cmd(n))
            return
        elif line.startswith("if"):
            _parse_script(menu, line, line_iter)

        else:
            menu.append(_parse_cmd(line))