diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index 17a0bce342f75a0d5ea2e511a88fe5ab8278d854..ab973413e7fb8fa0101f341ebdb8e9d1d2bc4cf4 100644 --- a/gdb-port/top-level-parse.py +++ b/gdb-port/top-level-parse.py @@ -450,43 +450,6 @@ class TopLevelParse: #charbuf_final = "\n".join(charbufrows) charbuf_final = "\n".join(charbufrows_token_debug) print(charbuf_final) - # Print by getting a token, and recursively walking its children if applicable - charbuf = [[' '] * w for i in range(0,h)] - charbuf_dynamic = [] - current_row = 0 - info_strings = [] - if not self.printing_tokens: # This ignores the passed-in token parameter if there are still tokens left to print - self.printing_tokens = [token] - while current_row < h and self.printing_tokens: - token = self.printing_tokens[-1] - #token = self.printing_tokens.pop() - tokenmap_entry = self.input_token_map[int(token.address)] - if tokenmap_entry['start'] > end: # Next token won't fit on the screen - break - self.printing_tokens.pop() - token_length = tokenmap_entry['end'] - tokenmap_entry['start'] # TODO: save tokenmap_values_sorted[i] - start_col = max(tokenmap_entry['start'] - start, 0) - end_col = min(tokenmap_entry['end'] - start, w) - charbuf_dynamic.append([' '] * w) - charbuf_dynamic[current_row][start_col:end_col] = ['X'] * min(token_length, end_col-start_col) - hparseresult_addr = tokenmap_entry['hparseresult'] - current_row += 1 - - if token.token_type == HParsedToken.TT_SEQUENCE: - self.printing_tokens.extend(token.children[::-1]) - - try: - hpr = HParseResult(int(hparseresult_addr, 16)) - info_strings.append(" ".join([hpr.str_no_deref(), str(tokenmap_entry)])) - except: - info_strings.append(" ".join(["invalid", str(tokenmap_entry)])) - - info_dict = dict(enumerate(info_strings)) - charbufrows_token_debug = [ "".join(row) + "\ntokeninfo: " + info_dict.get(index, "no token here") for index, row in enumerate(charbuf_dynamic)] - #charbufrows = ["".join(row) for row in charbuf_dynamic] - #charbuf_final = "\n".join(charbufrows) - charbuf_final = "\n".join(charbufrows_token_debug) - #print(charbuf_final) def print_input_map(self, token, parent_bounds=None): w = gdb.parameter("width")