. var x = $(echo hi) var x = ${x} var x = "quoted ${x}" . var x = y + 2 * 3; var x = r'one\ntwo\n'; var x = $'one\ntwo\n'; var x = "one\\ntwo\\n"; var x = [1,2,3]; var x = [4+5, 6+7*8] var x = [] var x = [x for x in y] . var x = %(a b); var x = %('c' $'string\n'); var x = %($(echo command) $(echo sub)); ----- '= x }' ^ ----- ----- '= x;}' ^ ----- ----- '= x; }' ^ ----- ----- 'echo $x;}' ^ ----- ----- 'echo $x; }' ^ ----- ----- '= x\n' ^ ----- ----- 'echo $x\n' ^ ----- --- $(echo hi) (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(CommandSub left_token: child:(C (w ) (w )) right: ) ) --- ${x} (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(${ VSub_Name x) ) --- "quoted ${x}" (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(DQ (${ VSub_Name x)) ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(expr.Binary op: left:(Var y) right:(expr.Binary op: left:(Const Expr_DecInt _) right:(Const Expr_DecInt _) ) ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(SingleQuoted left: sval:"one\\ntwo\\n" right: ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(SingleQuoted left: sval:"one\ntwo\n" right: ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(DQ (word_part.EscapedLiteral token: ch:"\\") (word_part.EscapedLiteral token: ch:"\\") ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(expr.List left: elts:[(Const Expr_DecInt _) (Const Expr_DecInt _) (Const Expr_DecInt _)] ctx:expr_context.Store ) ) terminator: ) (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(expr.List left: elts:[ (expr.Binary op: left:(Const Expr_DecInt _) right:(Const Expr_DecInt _) ) (expr.Binary op: left:(Const Expr_DecInt _) right:(expr.Binary op: left:(Const Expr_DecInt _) right:(Const Expr_DecInt _) ) ) ] ctx:expr_context.Store ) ) (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(expr.List left: elts:[] ctx:expr_context.Store) ) (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(expr.ListComp left: elt:(Var x) generators:[ (Comprehension lhs:[(NameType left: name:x)] iter:(Var y)) ] ) ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(ShArrayLiteral left: words:[(w ) (w )] right: ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(ShArrayLiteral left: words:[ (w (SQ c)) (w (SingleQuoted left: sval:"string\n" right: ) ) ] right: ) ) terminator: ) (command.Sentence child:(c var x = %(a b) * %($c ${d}); var x = %( a b c ); . var x = $(echo hi); var x = $(echo $(echo hi)); var x = $(echo hi) var x = $(echo $((1+2))); var x = $(for i in 1 2 3; do echo $i; done); var x = %(a b) ommand.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(ShArrayLiteral left: words:[ (w (CommandSub left_token: child:(C (w ) (w )) right: ) ) (w (CommandSub left_token: child:(C (w ) (w )) right: ) ) ] right: ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(expr.Binary op: left:(ShArrayLiteral left: words:[(w ) (w )] right: ) right:(ShArrayLiteral left: words:[(w ($ c)) (w (${ VSub_Name d))] right: ) ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(ShArrayLiteral left: words:[(w ) (w ) (w )] right: ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(CommandSub left_token: child:(C (w ) (w )) right: ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(CommandSub left_token: child:(C (w ) (w (CommandSub left_token: child:(C (w ) (w )) right: ) ) ) right: ) ) terminator: ) (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(CommandSub left_token: child:(command.CommandList children:[(C (w )) (C (w ))] ) right: ) ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(CommandSub left_token: child:(C (w ) (w (word_part.ArithSub left: anode:(arith_expr.Binary op: left:(w ) right:(w ) ) right: ) ) ) right: ) ) terminator: ) (command.Sentence child:(command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(CommandSub left_token: child:(command.ForEach keyword: iter_names:[i] iterable:(for_iter.Words words:[(w ) (w ) (w )] ) semi_tok: body:(command.DoGroup left: children:[ (command.Sentence child:(C (w ) (w ($ i))) terminator: ) ] right: ) ) right: ) ) terminator: ) (command.VarDecl keyword: lhs:[(NameType left: name:x)] rhs:(ShArrayLiteral left: words:[(. ---------------------------------------------------------------------- Ran 5 tests in 0.043s OK w ) (w )] right: ) )