From 88ebd116c9c74d09a7ee0a00cc70f7a7f59c5581 Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Tue, 25 Oct 2022 17:40:09 +0200 Subject: [PATCH] Cleanup --- gdb-port/top-level-parse.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index 353dead..47d9ecd 100644 --- a/gdb-port/top-level-parse.py +++ b/gdb-port/top-level-parse.py @@ -150,34 +150,7 @@ class TopLevelParse: def begin_new_token(self, index): token_bounds = (index, None) - #print("DEBUG: begin_new_token()") - #print("DEBUG: current parse depth:", self.current_parse_depth, "len(input_index_tree_path):", len(self.input_index_tree_path), "input_index_tree_path:", self.input_index_tree_path) - #print("DEBUG: path (truncated):", self.input_index_tree_path[0:self.current_parse_depth]) - #print("DEBUG: path:", self.input_index_tree_path) - #print("DEBUG: tokens:", self.input_stream_indices) - #print("DEBUG: current_parse_depth+1:", self.current_parse_depth+1, "len(input_index_tree_path):", len(self.input_index_tree_path)) - - #if self.current_parse_depth == 0: - # self.input_stream_indices.root.begin_token(index) - #elif len(self.input_index_tree_path) == self.current_parse_depth: # We haven't been this deep into the parse tree yet - # print("DEBUG: path (truncated):", self.input_index_tree_path[0:self.current_parse_depth]) - # print("DEBUG: path:", self.input_index_tree_path) - # print("DEBUG: tokens:", self.input_stream_indices) - # leaf = self.input_stream_indices.select_by_path(self.input_index_tree_path[0:self.current_parse_depth-1]) - # leaf.add_child_node(token_bounds) - # self.input_index_tree_path.append(0) - #elif len(self.input_index_tree_path) < self.current_parse_depth: - # raise RuntimeError("DEBUG: index tree path shorter than parse depth. this should never happen") - #else: - # print("DEBUG: path (truncated):", self.input_index_tree_path[0:self.current_parse_depth]) - # print("DEBUG: path:", self.input_index_tree_path) - # print("DEBUG: tokens:", self.input_stream_indices) - # node = self.input_stream_indices.select_by_path(self.input_index_tree_path[0:self.current_parse_depth]) - # node.add_child_node(token_bounds) - # self.input_index_tree_path[self.current_parse_depth] += 1 - # print("DEBUG: self.current_parse_depth:", self.current_parse_depth) - # print("DEBUG: path after begin_new_token():", self.input_index_tree_path) - + if len(self.input_index_tree_path) == 1 and self.current_parse_depth == 0: node = self.input_stream_indices.select_by_path([0]) try: -- GitLab