def parse_string_expr(self, string_expr_node):
        string_expr_node_value = string_expr_node['value']
        string_expr_str = string_expr_node_value[1:-1]

        # Care escaped string literals
        if string_expr_node_value[0] == "'":
            string_expr_str = string_expr_str.replace("''", "'")
        else:
            string_expr_str = string_expr_str.replace('\\"', '"')

        # NOTE: This is a hack to parse expr1. See :help expr1
        raw_ast = self.parse('echo ' + string_expr_str)

        # We need the left node of ECHO node
        parsed_string_expr_nodes = raw_ast['body'][0]['list']

        start_pos = string_expr_node['pos']

        def adjust_position(node):
            pos = node['pos']

            # Care 1-based index and the length of "echo ".
            pos['col'] += start_pos['col'] - 1 - 5

            # Care the length of "echo ".
            pos['i'] += start_pos['i'] - 5

            # Care 1-based index
            pos['lnum'] += start_pos['lnum'] - 1

        for parsed_string_expr_node in parsed_string_expr_nodes:
            traverse(parsed_string_expr_node, on_enter=adjust_position)

        return parsed_string_expr_nodes
Parse a command :redir content.
dataset/ETHPy150Open Kuniwak/vint/vint/ast/parsing.py/Parser.parse_string_expr