From be2c1a43000db0a84a76522b23b80d597e08f663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 4 Nov 2020 19:44:37 +0400 Subject: [PATCH] rewrite: fix modified member spelling --- mesonbuild/rewriter.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py index a412627ad..857ba0e37 100644 --- a/mesonbuild/rewriter.py +++ b/mesonbuild/rewriter.py @@ -353,7 +353,7 @@ class Rewriter: self.sourcedir = sourcedir self.interpreter = IntrospectionInterpreter(sourcedir, '', generator, visitors = [AstIDGenerator(), AstIndentationGenerator(), AstConditionLevel()]) self.skip_errors = skip_errors - self.modefied_nodes = [] + self.modified_nodes = [] self.to_remove_nodes = [] self.to_add_nodes = [] self.functions = { @@ -589,8 +589,8 @@ class Rewriter: # Convert the keys back to IdNode's arg_node.kwargs = {IdNode(Token('', '', 0, 0, 0, None, k)): v for k, v in arg_node.kwargs.items()} - if num_changed > 0 and node not in self.modefied_nodes: - self.modefied_nodes += [node] + if num_changed > 0 and node not in self.modified_nodes: + self.modified_nodes += [node] def find_assignment_node(self, node: BaseNode) -> AssignmentNode: if node.ast_id and node.ast_id in self.interpreter.reverse_assignment: @@ -671,8 +671,8 @@ class Rewriter: # Mark the node as modified if arg_node not in to_sort_nodes and not isinstance(node, FunctionNode): to_sort_nodes += [arg_node] - if node not in self.modefied_nodes: - self.modefied_nodes += [node] + if node not in self.modified_nodes: + self.modified_nodes += [node] elif cmd['operation'] == 'src_rm': # Helper to find the exact string node and its parent @@ -705,8 +705,8 @@ class Rewriter: # Mark the node as modified if arg_node not in to_sort_nodes and not isinstance(root, FunctionNode): to_sort_nodes += [arg_node] - if root not in self.modefied_nodes: - self.modefied_nodes += [root] + if root not in self.modified_nodes: + self.modified_nodes += [root] elif cmd['operation'] == 'target_add': if target is not None: @@ -781,12 +781,12 @@ class Rewriter: self.functions[cmd['type']](cmd) def apply_changes(self): - assert(all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'filename') for x in self.modefied_nodes)) + assert(all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'filename') for x in self.modified_nodes)) assert(all(hasattr(x, 'lineno') and hasattr(x, 'colno') and hasattr(x, 'filename') for x in self.to_remove_nodes)) - assert(all(isinstance(x, (ArrayNode, FunctionNode)) for x in self.modefied_nodes)) + assert(all(isinstance(x, (ArrayNode, FunctionNode)) for x in self.modified_nodes)) assert(all(isinstance(x, (ArrayNode, AssignmentNode, FunctionNode)) for x in self.to_remove_nodes)) # Sort based on line and column in reversed order - work_nodes = [{'node': x, 'action': 'modify'} for x in self.modefied_nodes] + work_nodes = [{'node': x, 'action': 'modify'} for x in self.modified_nodes] work_nodes += [{'node': x, 'action': 'rm'} for x in self.to_remove_nodes] work_nodes = list(sorted(work_nodes, key=lambda x: (x['node'].lineno, x['node'].colno), reverse=True)) work_nodes += [{'node': x, 'action': 'add'} for x in self.to_add_nodes]