def _parse(path):
    parse = parser.Parser()
    errors = lang.Errors()
    package = lang.Package()

    for fullpath, relpath in _walk(path):
        source = _read(fullpath)
        file, file_errors = parse.parse(source, relpath)

        if file_errors:
            errors.add_errors(file_errors)
        else:
            package.add_file(file)

    if errors:
        raise CompilerException('Syntax errors', errors)
    return package
Parse a package from a path.
dataset/ETHPy150Open pdef/pdef/compiler/pdefc/__init__.py/_parse