diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py index 353deadddf79f49c58139cd4476aa7aec1f6029c..47d9ecd6c4a904089c9ce070c923464e1a0af61b 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: