def decompress(self, data):
decompressed = "<STR_LIT>"<EOL>pos = <NUM_LIT:0><EOL>while pos < len(data):<EOL><INDENT>currentChar = data[pos]<EOL>if currentChar != self.referencePrefix:<EOL><INDENT>decompressed += currentChar<EOL>pos += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>nextChar = data[pos + <NUM_LIT:1>]<EOL>if nextChar != self.referencePrefix:<EOL><INDENT>distance = self.__decodeReferenceInt(<EOL>data[pos + <NUM_LIT:1>: pos + <NUM_LIT:3>], <NUM_LIT:2>)<EOL>length = self.__decodeReferenceLength(data[pos + <NUM_LIT:3>])<EOL>start = len(decompressed) - distance - length<EOL>end = start + length<EOL>decompressed += decompressed[start: end]<EOL>pos += self.minStringLength - <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>decompressed += self.referencePrefix<EOL>pos += <NUM_LIT:2><EOL><DEDENT><DEDENT><DEDENT>return decompressed<EOL>
Decompresses LZ77 compressed text data