@@ -20,7 +20,7 @@ def __init__(self, root):
20
20
self .no_children = {'operator' , 'reservedword' , 'pipe' , 'parameter' , 'tilde' , 'heredoc' }
21
21
self .parts_children = {'list' , 'pipeline' , 'if' , 'for' , 'while' , 'until' , 'command' , 'function' , 'word' , 'assignment' }
22
22
self .command_children = {'commandsubstitution' , 'processsubstitution' }
23
- self .passable_nodes = {'command' , 'list' , 'compound' , ' for' , 'parameter' , 'function' , 'pipeline' , 'if' , 'while' }
23
+ self .passable_nodes = {'command' , 'list' , 'for' , 'parameter' , 'function' , 'pipeline' , 'if' , 'while' }
24
24
self .list_children = {}
25
25
self .contains_variable_text = {'word' , 'assignment' }
26
26
@@ -38,6 +38,15 @@ def apply_fn(node):
38
38
if node .kind in self .passable_nodes : return CONT
39
39
elif node .kind == 'operator' : word = node .op
40
40
elif node .kind == 'pipe' : word = node .pipe
41
+ elif node .kind == 'redirect' : word = node .type + ' '
42
+ elif node .kind == 'compound' :
43
+ for part in node .list :
44
+ word += str (NodeVisitor (part )) + ' '
45
+ if hasattr (node , 'redirects' ):
46
+ for part in node .redirects :
47
+ word += str (NodeVisitor (part )) + ' '
48
+ self ._string = self ._string + word + ' '
49
+ return DONT_DESCEND
41
50
elif node .kind == 'commandsubstitution' :
42
51
word = '$('
43
52
cmd = node .command
0 commit comments