def compile(self, start_loc=<NUM_LIT:0>):
self.label_locs = {} if self.label_locs is None else self.label_locs<EOL>loc = start_loc<EOL>while loc < len(self.tape):<EOL><INDENT>if type(self.tape[loc]) == LABEL:<EOL><INDENT>self.label_locs[self.tape[loc].num] = loc<EOL>del self.tape[loc]<EOL>continue<EOL><DEDENT>loc += <NUM_LIT:1><EOL><DEDENT>self.compiled = True<EOL>
Records locations of labels and compiles the code