(command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} { (word_part.BracedVarSub token: <VSub_Name VARIABLES_SH> suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(true)}) ) } {(Lit_Other ']')} ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) (command.Assignment keyword: Assign_Declare flags: [-g] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:VARIABLES_SH) op:Equal rhs:{(true)})] ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) ) (/common.sh) } ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) ) (/logger.sh) } ) (command.Assignment keyword: Assign_Declare flags: [-g -A] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:VARIABLES_METADATA) op:Equal rhs:{(word_part.ArrayLiteralPart)})] ) (command.Assignment keyword: Assign_Declare flags: [-g -A] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:VARIABLES_VALUES) op:Equal rhs:{(word_part.ArrayLiteralPart)})] ) (command.Assignment keyword: Assign_Declare flags: [-g] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:VARIABLES_INDEX) op:Equal rhs:{(0)})] ) (command.Assignment keyword: Assign_Declare flags: [-g -A] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:VARIABLES_OFFSETS) op: Equal rhs: { (word_part.ArrayLiteralPart words: [{(Lit_Other '[') (type) (Lit_ArrayLhsClose ']=') (0)}] ) } ) ] ) (command.Assignment keyword: Assign_Declare flags: [-g] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:VARIABLES_DEBUG) op:Equal rhs:{(0)})] ) (command.Assignment keyword: Assign_Declare flags: [-g -A] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:VARIABLES_TYPES) op:Equal rhs:{(word_part.ArrayLiteralPart)})] ) (command.FuncDef name: 'variable::new' body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name VARIABLES_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('variable::new ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:token) op:Equal)] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Number 1))} right: {(DQ (-name))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(shift)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (C {(shift)}) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ ('auto#') (${ VSub_Name VARIABLES_INDEX))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:VARIABLES_INDEX) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(${ VSub_Name VARIABLES_INDEX)}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.BoolBinary op_id: BoolBinary_lt left: { (DQ (word_part.BracedVarSub token: <VSub_At '@'> prefix_op: VSub_Pound ) ) } right: {(1)} ) right: (bool_expr.BoolBinary op_id: BoolBinary_gt left: { (DQ (word_part.BracedVarSub token: <VSub_At '@'> prefix_op: VSub_Pound ) ) } right: {(2)} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('Usage: variable::new ?name? <type> <value>'))}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name type)}) ) suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(isset)}) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('Unknown variable type [') (${ VSub_Name type) (']'))}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_eq left: { (DQ (word_part.BracedVarSub token: <VSub_At '@'> prefix_op: VSub_Pound ) ) } right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:value) op:Equal rhs:{(DQ )})] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:metadata) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{($ VSub_DollarName '$type')}])} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_METADATA index: (arith_expr.ArithWord w:{(DQ (${ VSub_Name token))}) ) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name metadata> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_VALUES index: (arith_expr.ArithWord w:{(DQ (${ VSub_Name token))}) ) op: Equal rhs: {(DQ ($ VSub_DollarName '$value'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {(DQ ($ VSub_DollarName '$token'))} ) ] ) ] ) ) (command.FuncDef name: '_variable::new_p' body: (command.BraceGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(DQ (${ VSub_At '@'))}) (C {(echo)} {(DQ ($ VSub_DollarName '$RESULT'))}) ] ) ) (command.FuncDef name: 'variable::clone' body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name VARIABLES_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('variable::clone ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Number 1))} right: {(DQ (-name))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(shift)}) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (C {(shift)}) ] ) ] else_action: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ ('auto#') (${ VSub_Name VARIABLES_INDEX))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:VARIABLES_INDEX) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(${ VSub_Name VARIABLES_INDEX)}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) } ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.BoolBinary op_id: BoolBinary_lt left: { (DQ (word_part.BracedVarSub token: <VSub_At '@'> prefix_op: VSub_Pound ) ) } right: {(1)} ) right: (bool_expr.BoolBinary op_id: BoolBinary_gt left: { (DQ (word_part.BracedVarSub token: <VSub_At '@'> prefix_op: VSub_Pound ) ) } right: {(2)} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('Usage: variable::new ?name? <type> <value>'))}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:from_token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(DQ (${ VSub_Name from_token))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name from_token))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:metadata) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{($ VSub_DollarName '$type')}])} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_METADATA index: (arith_expr.ArithWord w:{(${ VSub_Name token)}) ) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name metadata> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_VALUES index: (arith_expr.ArithWord w:{(${ VSub_Name token)}) ) op: Equal rhs: {(DQ ($ VSub_DollarName '$value'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {(DQ ($ VSub_DollarName '$token'))} ) ] ) ] ) ) (command.FuncDef name: 'variable::set' body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name VARIABLES_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('variable::set ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_ne left: {(word_part.BracedVarSub token:<VSub_At '@'> prefix_op:VSub_Pound)} right: {(3)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('Usage: variable::set <variable token> <type> <value>'))}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value) op: Equal rhs: {(DQ ($ VSub_Number '$3'))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name type)}) ) suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(isset)}) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('Unknown variable type [') (${ VSub_Name type) (']'))}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:metadata) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{($ VSub_DollarName '$type')}])} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_METADATA index: (arith_expr.ArithWord w:{(${ VSub_Name token)}) ) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name metadata> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_VALUES index: (arith_expr.ArithWord w:{(${ VSub_Name token)}) ) op: Equal rhs: {(DQ ($ VSub_DollarName '$value'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:RESULT) op:Equal rhs:{(DQ )})] ) ] ) ) (command.FuncDef name: 'variable::type' body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name VARIABLES_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('variable::type ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:index) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} { (DQ (word_part.BracedVarSub token: <VSub_Name VARIABLES_METADATA> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name index)}) ) suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(isset)}) ) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('The variable token [') (${ VSub_Name index) ('] does not exist'))} ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:metadata) op: Equal rhs: { (word_part.ArrayLiteralPart words: [ { (word_part.BracedVarSub token: <VSub_Name VARIABLES_METADATA> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$index')}) ) ) } ] ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name metadata> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name VARIABLES_OFFSETS> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithVarRef token:<Lit_ArithVarLike type>) ) ) } ) ) ) } ) ] ) ] ) ) (command.FuncDef name: '_variable::type_p' body: (command.BraceGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(DQ (${ VSub_At '@'))}) (C {(echo)} {(DQ ($ VSub_DollarName '$RESULT'))}) ] ) ) (command.FuncDef name: 'variable::type::define' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:typeName) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:typeParents) op:Equal rhs:{(word_part.ArrayLiteralPart)})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name typeName)}) ) suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(isset)}) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('Variable type [') (${ VSub_Name typeName) ('] already defined'))} ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:superTypes) op:Equal)] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} { (word_part.BracedVarSub token: <VSub_Number 2> suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(isset)}) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:typeParent) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ VSub_DollarName '$typeParent')} ) ) suffix_op: (suffix_op.StringUnary op_id: VTest_Plus arg_word: {(true)} ) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} { (DQ ('Variable type [') (${ VSub_Name typeName) ('] declare unknown parent type [') (${ VSub_Name typeParent) (']') ) } ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:typeParents) op: PlusEqual rhs: {(word_part.ArrayLiteralPart words:[{(DQ (${ VSub_Name typeParent))}])} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:typeParents) op: PlusEqual rhs: { (word_part.ArrayLiteralPart words: [ { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name typeParent)}) ) ) } ] ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_TYPES index: (arith_expr.ArithWord w:{(${ VSub_Name typeName)}) ) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name typeParents> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ) ] ) ] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name: VARIABLES_TYPES index: (arith_expr.ArithWord w:{(${ VSub_Name typeName)}) ) op: Equal rhs: {(DQ )} ) ] ) ] ) ] ) ) (command.FuncDef name: 'variable::type::instanceOf' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expectedType) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (exactlyA) } {(DQ (${ VSub_Name token))} {(DQ (${ VSub_Name expectedType))} ) terminator: <Op_Semi ';'> ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(DQ (${ VSub_Name token))}) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:actualType) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:actualSuperTypes) op: Equal rhs: { (word_part.ArrayLiteralPart words: [ { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$actualType')}) ) ) } ] ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} { (word_part.BracedVarSub token: <VSub_Name actualSuperTypes> prefix_op: VSub_Pound bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) } {(-lt)} {(1)} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) terminator: <Op_Semi ';'> ) ] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:superType) op:Equal)] ) (command.ForEach iter_name: superType iter_words: [ { (DQ (word_part.BracedVarSub token: <VSub_Name actualSuperTypes> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ (${ VSub_Name expectedType))} {(Lit_Other '=') (Lit_Other '=')} {(DQ (${ VSub_Name superType))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] ) ] ) ] ) ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) ) (command.FuncDef name: 'variable::type::instanceOfOrExit' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:valueToken) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expectedType) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (instanceOf) } {(DQ (${ VSub_Name valueToken))} {(DQ (${ VSub_Name expectedType))} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(DQ (${ VSub_Name valueToken))} ) (C {(stderr)} { (DQ ('Variable [') (${ VSub_Name valueToken) ('] is not of type [') (${ VSub_Name expectedType) ('] (actual type [') (${ VSub_Name RESULT) ('])') ) } ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) ] ) ) (command.FuncDef name: 'variable::type::exactlyA' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:expectedType) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$expectedType')}) ) suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(true)}) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('Unknown type [') (${ VSub_Name expectedType) (']'))}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(DQ (${ VSub_Name token))}) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:actualType) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {(DQ (${ VSub_Name actualType))} {(Lit_Other '=') (Lit_Other '=')} {(DQ (${ VSub_Name expectedType))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})] ) ] else_action: [(command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})] ) ] ) ) (command.FuncDef name: 'variable::value' body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name VARIABLES_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('variable::value ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:index) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(Lit_Other '[')} { (DQ (word_part.BracedVarSub token: <VSub_Name VARIABLES_VALUES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name index)}) ) suffix_op: (suffix_op.StringUnary op_id: VTest_Plus arg_word: {(isset)} ) ) ) } {(Lit_Other ']')} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(stderr)} {(DQ ('The variable token [') (${ VSub_Name index) ('] does not exist'))} ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Name VARIABLES_VALUES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name index)}) ) ) } ) ] ) ] ) ) (command.FuncDef name: '_variable::value_p' body: (command.BraceGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_At '@'))}) (C {(echo)} {(DQ ($ VSub_DollarName '$RESULT'))}) ] ) ) (command.FuncDef name: 'variable::debug' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {($ VSub_DollarName '$token')}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(functionExists)} {(DQ ('variable::') (${ VSub_Name type) ('::debug'))}) terminator: <Op_Semi ';'> ) ] action: [ (C {(eval)} {(DQ ('variable::') (${ VSub_Name type) ('::debug ') (${ VSub_Name token))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolUnary op_id: BoolUnary_z child: { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name type)}) ) ) } ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (debug) (Lit_Other ':') (Lit_Other ':') (simple) } {($ VSub_DollarName '$token')} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:actualSuperTypes) op: Equal rhs: { (word_part.ArrayLiteralPart words: [ { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$type')}) ) ) } ] ) } ) ] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:superType) op:Equal)] ) (command.ForEach iter_name: superType iter_words: [ { (DQ (word_part.BracedVarSub token: <VSub_Name actualSuperTypes> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(functionExists)} {(DQ ('variable::') (${ VSub_Name superType) ('::debug'))} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(eval)} { (DQ ('variable::') (${ VSub_Name superType) ('::debug ') (${ VSub_Name token) ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.ControlFlow token: <ControlFlow_Return return> ) ] ) ] ) ] ) ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (debug) (Lit_Other ':') (Lit_Other ':') (simple)} {($ VSub_DollarName '$token')} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) ] ) ) (command.FuncDef name: 'variable::debug::simple' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(DQ (${ VSub_Name token))}) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name token))}) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {(DQ (${ VSub_Name type) (' :: ') (${ VSub_Name value))} ) ] ) ] ) ) (command.FuncDef name: 'variable::debug::join' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:joinChar) op: Equal rhs: {(${ VSub_Number 1)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(word_part.BracedVarSub token:<VSub_At '@'> prefix_op:VSub_Pound)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:RESULT) op:Equal rhs:{(DQ )})] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobDEqual left: {(word_part.BracedVarSub token:<VSub_At '@'> prefix_op:VSub_Pound)} right: {(2)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:items) op: Equal rhs: { (word_part.ArrayLiteralPart words: [ { (DQ (word_part.BracedVarSub token: <VSub_At '@'> suffix_op: (suffix_op.Slice begin: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) ) ) } ] ) } ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs:(lhs_expr.LhsName name:size) op:Equal) (assign_pair lhs:(lhs_expr.LhsName name:declare) op:Equal) (assign_pair lhs:(lhs_expr.LhsName name:max_index) op:Equal) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.DParen child: (arith_expr.ArithBinary op_id: Arith_Comma left: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:size) right: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name items> prefix_op: VSub_Pound bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) } ) ) right: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:max_index) right: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithVarRef token:<Lit_ArithVarLike size>) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) ) ) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (lhs_expr.LhsName name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) cond: (arith_expr.ArithBinary op_id: Arith_LessEqual left: (arith_expr.ArithVarRef token:<Lit_ArithVarLike i>) right: (arith_expr.ArithVarRef token:<Lit_ArithVarLike max_index>) ) update: (arith_expr.BinaryAssign op_id: Arith_PlusEqual left: (lhs_expr.LhsName name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) body: (command.DoGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: { (DQ (${ VSub_Name RESULT) (${ VSub_Name joinChar) (word_part.BracedVarSub token: <VSub_Name items> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')}) ) ) ) } ) ] ) ] ) ) ] ) ) (command.FuncDef name: 'variable::toSexp' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {($ VSub_DollarName '$token')}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(functionExists)} {(DQ ('variable::') (${ VSub_Name type) ('::toSexp'))}) terminator: <Op_Semi ';'> ) ] action: [ (C {(eval)} {(DQ ('variable::') (${ VSub_Name type) ('::toSexp ') (${ VSub_Name token))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolUnary op_id: BoolUnary_z child: { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name type)}) ) ) } ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (debug)} {($ VSub_DollarName '$token')} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:actualSuperTypes) op: Equal rhs: { (word_part.ArrayLiteralPart words: [ { (word_part.BracedVarSub token: <VSub_Name VARIABLES_TYPES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$type')}) ) ) } ] ) } ) ] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:superType) op:Equal)] ) (command.ForEach iter_name: superType iter_words: [ { (DQ (word_part.BracedVarSub token: <VSub_Name actualSuperTypes> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(functionExists)} {(DQ ('variable::') (${ VSub_Name superType) ('::toSexp'))} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(eval)} { (DQ ('variable::') (${ VSub_Name superType) ('::toSexp ') (${ VSub_Name token) ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.ControlFlow token: <ControlFlow_Return return> ) ] ) ] ) ] ) ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (debug)} {($ VSub_DollarName '$token')}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) ] ) ) (command.FuncDef name: 'variable::printMetadata' body: (command.BraceGroup children: [ (C {(stderr)} {(DQ (VARIABLES_METADATA))}) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:keys) op:Equal)] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:keys) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.ForEach iter_name: var iter_words: [ { (DQ (word_part.BracedVarSub token: <VSub_Name VARIABLES_METADATA> prefix_op: VSub_Bang bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {(DQ ($ VSub_DollarName '$var'))}) terminator: <Op_Semi ';'> ) ] ) ) (C {(sort)} {(-n)}) ] negated: F ) ] ) left_token: <Left_DollarParen '$('> ) } ) ] ) (command.ForEach iter_name: key iter_words: [{(${ VSub_Name keys)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(stderr)} { (DQ (' [') (${ VSub_Name key) (']=[') (word_part.BracedVarSub token: <VSub_Name VARIABLES_METADATA> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name key)}) ) ) (']') ) } ) ] ) ) (C {(stderr)} {(DQ (VARIABLES_VALUES))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:keys) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.ForEach iter_name: var iter_words: [ { (DQ (word_part.BracedVarSub token: <VSub_Name VARIABLES_VALUES> prefix_op: VSub_Bang bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(echo)} {(DQ ($ VSub_DollarName '$var'))}) terminator: <Op_Semi ';'> ) ] ) ) (C {(sort)} {(-n)}) ] negated: F ) ] ) left_token: <Left_DollarParen '$('> ) } ) ] ) (command.ForEach iter_name: key iter_words: [{(${ VSub_Name keys)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(stderr)} { (DQ (' [') (${ VSub_Name key) (']=[') (word_part.BracedVarSub token: <VSub_Name VARIABLES_VALUES> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(${ VSub_Name key)}) ) ) (']') ) } ) ] ) ) (C {(stderr)} {(DQ ('VARIABLES_INDEX=') (${ VSub_Name VARIABLES_INDEX))}) ] ) ) (command.FuncDef name: 'variable::print' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:token) op: Equal rhs: {($ VSub_Number '$1')} ) ] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:indent) op: Equal rhs: {($ VSub_Number '$2')} ) ] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(${ VSub_Name token)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:type) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) (command.Case to_match: {(${ VSub_Name type)} arms: [ (case_arm pat_list: [{(list)}] action: [ (C {(echo)} { (DQ (${ VSub_Name indent) (${ VSub_Name type) ('(') (${ VSub_Name token) (') :: [') ) } ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(${ VSub_Name token)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare flags: [-a] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:values) op: Equal rhs: {(word_part.ArrayLiteralPart words:[{($ VSub_DollarName '$RESULT')}])} ) ] ) (command.ForEach iter_name: value iter_words: [ { (word_part.BracedVarSub token: <VSub_Name values> bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (print)} {(${ VSub_Name value)} {(DQ (${ VSub_Name indent) (' '))} ) ] ) ) (C {(echo)} {(DQ (${ VSub_Name indent) (']'))}) ] ) (case_arm pat_list: [{(string)}] action: [ (C {(echo)} { (DQ (${ VSub_Name indent) (${ VSub_Name type) ('(') (${ VSub_Name token) (') :: [') (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(_variable) (Lit_Other ':') (Lit_Other ':') (value_p)} {(${ VSub_Name token)} ) ] ) left_token: <Left_DollarParen '$('> ) (']') ) } ) ] ) (case_arm pat_list: [{(integer)}] action: [ (C {(echo)} { (DQ (${ VSub_Name indent) (${ VSub_Name type) ('(') (${ VSub_Name token) (') :: [') (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(_variable) (Lit_Other ':') (Lit_Other ':') (value_p)} {(${ VSub_Name token)} ) ] ) left_token: <Left_DollarParen '$('> ) (']') ) } ) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (C {(stderr)} { (DQ ('Invalid variable type [') (${ VSub_Name type) ('] for token [') (${ VSub_Name token) (']') ) } ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (printMetadata)}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {($ VSub_Number '$0')} {(KW_Bang '!') (Lit_Other '=')} {($ VSub_DollarName '$BASH_SOURCE')} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(command.ControlFlow token:<ControlFlow_Return return>)] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:testToken) op:Equal)] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (define)} {(atom)} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (define)} {(string)} {(atom)} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (define)} {(number)} {(atom)} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (define)} {(integer)} {(number)} ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(integer)} {(12)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:atomId_1) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {($ VSub_DollarName '$atomId_1')}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(integer)} {(DQ ($ VSub_DollarName '$RESULT'))} {(Type)} {(of)} {(first)} {(atom)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {(DQ (${ VSub_Name atomId_1))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(integer)} {(DQ ($ VSub_DollarName '$RESULT'))} {(Type)} {(of)} {(first)} {(atom)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {($ VSub_DollarName '$atomId_1')}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(12)} {(DQ ($ VSub_DollarName '$RESULT'))} {(Value)} {(of)} {(first)} {(atom)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {($ VSub_DollarName '$atomId_1')}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(12)} {(DQ ($ VSub_DollarName '$RESULT'))} {(Value)} {(of)} {(first)} {(atom)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(string)} {(DQ ('hello there'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:atomId_2) op: Equal rhs: {($ VSub_DollarName '$RESULT')} ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {($ VSub_DollarName '$atomId_2')}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(string)} {(DQ ($ VSub_DollarName '$RESULT'))} {(Type)} {(of)} {(second)} {(atom)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {($ VSub_DollarName '$atomId_2')}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('hello there'))} {(DQ ($ VSub_DollarName '$RESULT'))} {(Value)} {(of)} {(second)} {(atom)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {($ VSub_DollarName '$atomId_1')}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(12)} {(DQ ($ VSub_DollarName '$RESULT'))} {(Value)} {(of)} {(first)} {(atom)} {(remains)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(integer)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:testToken) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) ] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {($ VSub_DollarName '$testToken')}) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (exactlyA)} {(DQ (${ VSub_Name testToken))} {(integer)} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(0)} {($ VSub_QMark '$?')} {(DQ ('exactlyA same'))} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (exactlyA)} {(DQ (${ VSub_Name testToken))} {(number)} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(1)} {($ VSub_QMark '$?')} {(DQ ('exactlyA super'))} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (exactlyA)} {(DQ (${ VSub_Name testToken))} {(string)} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(1)} {($ VSub_QMark '$?')} {(DQ ('exactlyA other'))} ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(number)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:testToken) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} ) ] ) ] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type)} {($ VSub_DollarName '$testToken')}) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (instanceOf)} {(DQ (${ VSub_Name testToken))} {(integer)} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(1)} {($ VSub_QMark '$?')} {(DQ ('number instanceOf integer'))} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (instanceOf)} {(DQ (${ VSub_Name testToken))} {(number)} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(0)} {($ VSub_QMark '$?')} {(DQ ('number instanceOf number'))} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (instanceOf)} {(DQ (${ VSub_Name testToken))} {(atom)} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(0)} {($ VSub_QMark '$?')} {(DQ ('number instanceOf atom'))} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (type) (Lit_Other ':') (Lit_Other ':') (instanceOf)} {(DQ (${ VSub_Name testToken))} {(string)} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(1)} {($ VSub_QMark '$?')} {(DQ ('number instanceOf string'))} ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (report)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} { (word_part.BracedVarSub token: <VSub_Number 1> suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(isset)}) ) } {(Lit_Other ']')} ) (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=') (Lit_Other '=')} {(DQ (debug))} {(Lit_Other ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [(C {(variable) (Lit_Other ':') (Lit_Other ':') (printMetadata)})] ) ] ) ] )