def parse_xcodeproject_plist_direct(text, dictionarytype=dict):
    t0 = time.time()
    text = unistr(text)

    tokenrules = []
    tokentexts = []
    offsets = []
    num_comments = 0

    prjname = None
    pos = skip_whitespace(text)
    for m in r_tokenize.finditer(text, pos):
        if m.start() != pos:
            # The found fragments must be contiguous for a valid parse
            break
        rule_number = m.lastindex
        # Only count comments to eventually unparse the file
        # with or without comments depending on if there were comments.
        if rule_number == RULE_COMMENT:
            # The unparser needs the project name which should be known from the filename
            # or from a parameter that was passed in. Pulling the project name
            # out of a comment is our only other chance but still it might be wrong.
            if prjname is None:
                prjname = projectname_from_comment(m.group(rule_number))
            num_comments += 1
        elif rule_number == RULE_LINECOMMENT:
            pass
        else:
            tokenrules.append(rule_number)
            tokentexts.append(m.group(rule_number))
            offsets.append(pos)

        pos = m.end()

    lastpos = pos

    parseinfo = {'num_comments': num_comments}
    success, root = parse_tokens(tokenrules, tokentexts,
                                 dictionarytype=dictionarytype)

    if not success:
        tokenpos = errortokenpos(root)
        if tokenpos < len(tokenrules):
            errstart = offsets[tokenpos]
            errstop = errstart + len(tokentexts[tokenpos])
        else:
            errstart = errstop = lastpos
        parseinfo.update(error_report_dict(text, errstart, errstop, 'Xcode plist classically'))
        return None, parseinfo

    parseinfo = {
        'format': 'xcode',
        'parsetime': time.time() - t0,
        'parser': 'classic',
    }
    if prjname is not None:
        parseinfo['projectname'] = prjname
    return root, parseinfo
dataset/ETHPy150Open mikr/xcodeprojer/xcodeprojer.py/parse_xcodeproject_plist_direct/original