def test_process_with_filter_function(self): ast = self.create_ast(Fixtures.MAP_AND_FILTER_VARIABLE) parser = MapAndFilterParser() got_ast = parser.process(ast) string_expr_nodes = get_string_expr_content(got_ast['body'][1]['left']) self.assertEqual('v:key', string_expr_nodes[0]['left'].get('value'))
def _enter_str_expr_content_node(self, call_node): string_expr_content_nodes = get_string_expr_content(call_node) if not string_expr_content_nodes: return def enter_handler(node): self._enter_identifier_like_node(node, is_on_str_expr_context=True) for string_expr_content_node in string_expr_content_nodes: traverse(string_expr_content_node, on_enter=enter_handler)