def parse(self):
index_server = None<EOL>for num, line in enumerate(self.iter_lines()):<EOL><INDENT>line = line.rstrip()<EOL>if not line:<EOL><INDENT>continue<EOL><DEDENT>if line.startswith('<STR_LIT:#>'):<EOL><INDENT>continue<EOL><DEDENT>if line.startswith('<STR_LIT>') orline.startswith('<STR_LIT>') orline.startswith('<STR_LIT>'):<EOL><INDENT>index_server = self.parse_index_server(line)<EOL>continue<EOL><DEDENT>elif self.obj.path and (line.startswith('<STR_LIT>') or line.startswith('<STR_LIT>')):<EOL><INDENT>self.obj.resolved_files.append(self.resolve_file(self.obj.path, line))<EOL><DEDENT>elif line.startswith('<STR_LIT>') or line.startswith('<STR_LIT>') orline.startswith('<STR_LIT>') or line.startswith('<STR_LIT>') orline.startswith('<STR_LIT>') or line.startswith('<STR_LIT>') orline.startswith('<STR_LIT>'):<EOL><INDENT>continue<EOL><DEDENT>elif self.is_marked_line(line):<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>parseable_line = line<EOL>if "<STR_LIT:\\>" in line:<EOL><INDENT>parseable_line = line.replace("<STR_LIT:\\>", "<STR_LIT>")<EOL>for next_line in self.iter_lines(num + <NUM_LIT:1>):<EOL><INDENT>parseable_line += next_line.strip().replace("<STR_LIT:\\>", "<STR_LIT>")<EOL>line += "<STR_LIT:\n>" + next_line<EOL>if "<STR_LIT:\\>" in next_line:<EOL><INDENT>continue<EOL><DEDENT>break<EOL><DEDENT>if self.is_marked_line(parseable_line):<EOL><INDENT>continue<EOL><DEDENT><DEDENT>hashes = []<EOL>if "<STR_LIT>" in parseable_line:<EOL><INDENT>parseable_line, hashes = Parser.parse_hashes(parseable_line)<EOL><DEDENT>req = RequirementsTXTLineParser.parse(parseable_line)<EOL>if req:<EOL><INDENT>req.hashes = hashes<EOL>req.index_server = index_server<EOL>req.line = line<EOL>self.obj.dependencies.append(req)<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT>
Parses a requirements.txt-like file