(command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} { (word_part.BracedVarSub token: <VSub_Name ENVIRONMENT_SH> suffix_op: (suffix_op.StringUnary op_id:VTest_Plus arg_word:{(isset)}) spids: [9 13] ) } {(Lit_Other ']')} ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) (command.Assignment keyword: Assign_Declare flags: [-g] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ENVIRONMENT_SH spids:[25]) op: Equal rhs: {(true)} spids: [25] ) ] spids: [21] ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) spids: [59 64] ) (/common.sh) } ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) spids: [69 74] ) (/variables.sh) } ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) spids: [79 84] ) (/variables.arraylist.sh) } ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) spids: [89 94] ) (/variables.linkedlist.sh) } ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) spids: [99 104] ) (/variables.stack.sh) } ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) spids: [109 114] ) (/variables.queue.sh) } ) (C {(.)} { (word_part.BracedVarSub token: <VSub_Name BASH_SOURCE> suffix_op: (suffix_op.StringUnary op_id:VOp1_Percent arg_word:{(Lit_Slash /) ('*')}) spids: [119 124] ) (/variables.map.sh) } ) (command.Assignment keyword: Assign_Declare flags: [-g] pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ENVIRONMENT_DEBUG spids:[133]) op: Equal rhs: {(0)} spids: [133] ) ] spids: [129] ) (command.FuncDef name: 'environment::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 ENVIRONMENT_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('environment::new ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] spids: [16777215 195] ) ] spids: [16777215 208] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (new) } ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env spids:[222]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [222] ) ] spids: [222] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (new)} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (prepend) } {(DQ (${ VSub_Name env))} {(DQ (${ VSub_Name RESULT))} ) ] spids: [177] ) spids: [168 176] ) (command.FuncDef name: 'environment::pushScope' 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 ENVIRONMENT_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('environment::pushScope ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] spids: [16777215 311] ) ] spids: [16777215 324] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env spids:[330]) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [330] ) ] spids: [328] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (new)} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (prepend) } {(DQ (${ VSub_Name env))} {(DQ (${ VSub_Name RESULT))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT spids:[370]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [370] ) ] spids: [370] ) ] spids: [293] ) spids: [284 292] ) (command.FuncDef name: 'environment::popScope' 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 ENVIRONMENT_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('environment::popScope ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] spids: [16777215 434] ) ] spids: [16777215 447] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (rest) } {(DQ ($ VSub_Number '$1'))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT spids:[464]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [464] ) ] spids: [464] ) ] spids: [416] ) spids: [407 415] ) (command.FuncDef name: 'environment::hasValue' 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 ENVIRONMENT_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('environment::getValue ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] spids: [16777215 516] ) ] spids: [16777215 529] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env spids:[535]) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [535] ) ] spids: [533] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:name spids:[545]) op: Equal rhs: {(DQ (${ VSub_Number 2))} spids: [545] ) ] spids: [543] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[555]) op: Equal spids: [555] ) ] spids: [553] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ (${ VSub_Name name))} ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:keyToken spids:[576]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [576] ) ] spids: [574] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[587]) op: Equal rhs: {(DQ (${ VSub_Name env))} spids: [587] ) ] spids: [585] ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (isEmpty_c) } {(DQ (${ VSub_Name currentEnv))} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (first) } {(DQ (${ VSub_Name currentEnv))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[633]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [633] ) ] spids: [633] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (containsKey_c) } {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name name))} ) terminator: <Op_Semi ';'> ) ] action: [ (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] spids: [16777215 665] ) ] spids: [16777215 673] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (rest) } {(DQ (${ VSub_Name currentEnv))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[692]) op: Equal rhs: {(DQ ($ VSub_DollarName '$RESULT'))} spids: [692] ) ] spids: [692] ) ] spids: [615 698] ) ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [498] ) spids: [489 497] ) (command.FuncDef name: 'environment::getValue' 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 ENVIRONMENT_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('environment::getValue ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] spids: [16777215 754] ) ] spids: [16777215 767] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env spids:[773]) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [773] ) ] spids: [771] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:name spids:[783]) op: Equal rhs: {(DQ (${ VSub_Number 2))} spids: [783] ) ] spids: [781] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[793]) op: Equal spids: [793] ) ] spids: [791] ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ (${ VSub_Name name))} ) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:keyToken spids:[814]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [814] ) ] spids: [812] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[825]) op: Equal rhs: {(DQ (${ VSub_Name env))} spids: [825] ) ] spids: [823] ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (isEmpty_c) } {(DQ (${ VSub_Name currentEnv))} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (first) } {(DQ (${ VSub_Name currentEnv))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[871]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [871] ) ] spids: [871] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (containsKey_c) } {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name name))} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (get) } {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name name))} ) (command.ControlFlow token: <ControlFlow_Return return> ) ] spids: [16777215 903] ) ] spids: [16777215 930] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (rest) } {(DQ (${ VSub_Name currentEnv))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[949]) op: Equal rhs: {(DQ ($ VSub_DollarName '$RESULT'))} spids: [949] ) ] spids: [949] ) ] spids: [853 955] ) ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {($ VSub_DollarName '$name')}) (C {(stderr)} { (DQ ('Variable [') (${ VSub_Name name) ('=') (${ VSub_Name RESULT) ('] not found in current environment') ) } ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [736] ) spids: [727 735] ) (command.FuncDef name: 'environment::setVariable' 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 ENVIRONMENT_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('environment::setVariable ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] spids: [16777215 1043] ) ] spids: [16777215 1056] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env spids:[1062]) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [1062] ) ] spids: [1060] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:keyToken spids:[1072]) op: Equal rhs: {(DQ (${ VSub_Number 2))} spids: [1072] ) ] spids: [1070] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:valueToken spids:[1082]) op: Equal rhs: {(DQ (${ VSub_Number 3))} spids: [1082] ) ] spids: [1080] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (first) } {(DQ (${ VSub_Name env))} ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[1108]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [1108] ) ] spids: [1106] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:returnValue spids:[1118]) op: Equal spids: [1118] ) ] spids: [1116] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (containsKey_c) } {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name keyToken))} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:returnValue spids:[1149]) op: Equal rhs: {(0)} spids: [1149] ) ] spids: [1149] ) ] spids: [16777215 1146] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:returnValue spids:[1156]) op: Equal rhs: {(1)} spids: [1156] ) ] spids: [1156] ) ] spids: [1153 1160] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (put)} {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name keyToken))} {(DQ (${ VSub_Name valueToken))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT spids:[1191]) op: Equal rhs: {(DQ )} spids: [1191] ) ] spids: [1191] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {($ VSub_DollarName '$returnValue')} ) ] spids: [1025] ) spids: [1016 1024] ) (command.FuncDef name: 'environment::setOrReplaceVariable' 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 ENVIRONMENT_DEBUG)} right: {(1)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (C {(stderr)} {(DQ ('environment::setOrReplaceVariable ') (${ VSub_At '@'))}) terminator: <Op_Semi ';'> ) ] spids: [16777215 1249] ) ] spids: [16777215 1262] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env spids:[1268]) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [1268] ) ] spids: [1266] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:keyToken spids:[1278]) op: Equal rhs: {(DQ (${ VSub_Number 2))} spids: [1278] ) ] spids: [1276] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:valueToken spids:[1288]) op: Equal rhs: {(DQ (${ VSub_Number 3))} spids: [1288] ) ] spids: [1286] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[1298]) op: Equal spids: [1298] ) ] spids: [1296] ) (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[1304]) op: Equal rhs: {(DQ (${ VSub_Name env))} spids: [1304] ) ] spids: [1302] ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (isEmpty_c) } {(DQ (${ VSub_Name currentEnv))} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (first) } {(DQ (${ VSub_Name currentEnv))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[1350]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [1350] ) ] spids: [1350] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (containsKey_c) } {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name keyToken))} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (put) } {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name keyToken))} {(DQ (${ VSub_Name valueToken))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT spids:[1412]) op: Equal rhs: {(DQ )} spids: [1412] ) ] spids: [1412] ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] spids: [16777215 1382] ) ] spids: [16777215 1422] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (rest) } {(DQ (${ VSub_Name currentEnv))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[1441]) op: Equal rhs: {(DQ ($ VSub_DollarName '$RESULT'))} spids: [1441] ) ] spids: [1441] ) ] spids: [1332 1447] ) ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (first) } {(DQ (${ VSub_Name env))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:scope spids:[1470]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [1470] ) ] spids: [1470] ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (put)} {(DQ (${ VSub_Name scope))} {(DQ (${ VSub_Name keyToken))} {(DQ (${ VSub_Name valueToken))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:RESULT spids:[1505]) op: Equal rhs: {(DQ )} spids: [1505] ) ] spids: [1505] ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [1231] ) spids: [1222 1230] ) (command.FuncDef name: 'environment::print' body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Declare pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[1531]) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [1531] ) ] spids: [1529] ) (C {(echo)} {(DQ ('Environment [') (${ VSub_Name currentEnv) (']'))}) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (isEmpty_c) } {(DQ (${ VSub_Name currentEnv))} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (first) } {(DQ (${ VSub_Name currentEnv))} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (Map) (Lit_Other ':') (Lit_Other ':') (print) } {(DQ (${ VSub_Name RESULT))} ) (C {(variable) (Lit_Other ':') (Lit_Other ':') (LinkedList) (Lit_Other ':') (Lit_Other ':') (rest) } {(DQ (${ VSub_Name currentEnv))} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:currentEnv spids:[1621]) op: Equal rhs: {(DQ ($ VSub_DollarName '$RESULT'))} spids: [1621] ) ] spids: [1621] ) ] spids: [1572 1627] ) ) ] spids: [1526] ) spids: [1517 1525] ) (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>)] spids: [16777215 1649] ) ] spids: [16777215 1654] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ ('key one'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:key1 spids:[1670]) op: Equal rhs: {(${ VSub_Name RESULT)} spids: [1670] ) ] spids: [1670] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ ('value one'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value1 spids:[1688]) op: Equal rhs: {(${ VSub_Name RESULT)} spids: [1688] ) ] spids: [1688] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ ('key two'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:key2 spids:[1706]) op: Equal rhs: {(${ VSub_Name RESULT)} spids: [1706] ) ] spids: [1706] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ ('value two'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value2 spids:[1724]) op: Equal rhs: {(${ VSub_Name RESULT)} spids: [1724] ) ] spids: [1724] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ ('key three'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:key3 spids:[1742]) op: Equal rhs: {(${ VSub_Name RESULT)} spids: [1742] ) ] spids: [1742] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ ('value three'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:value3 spids:[1760]) op: Equal rhs: {(${ VSub_Name RESULT)} spids: [1760] ) ] spids: [1760] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (new)} {(String)} {(DQ ('no such key'))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:keyUnknown spids:[1778]) op: Equal rhs: {(${ VSub_Name RESULT)} spids: [1778] ) ] spids: [1778] ) ] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:env1 spids:[1785]) op:Equal spids:[1785])] spids: [1783] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:env2 spids:[1789]) op:Equal spids:[1789])] spids: [1787] ) (command.Assignment keyword: Assign_Declare pairs: [(assign_pair lhs:(lhs_expr.LhsName name:env3 spids:[1793]) op:Equal spids:[1793])] spids: [1791] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (new)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env1 spids:[1803]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [1803] ) ] spids: [1803] ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setVariable)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key1')} {($ VSub_DollarName '$value1')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value one'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Single variable'))} ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setVariable)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key2')} {($ VSub_DollarName '$value2')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value one'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Multiple variables, first'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key2')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value two'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Multiple variables, second'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (new)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env1 spids:[2023]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [2023] ) ] spids: [2023] ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setVariable)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key1')} {($ VSub_DollarName '$value1')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (pushScope)} {(DQ (${ VSub_Name env1))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env2 spids:[2058]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [2058] ) ] spids: [2058] ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setVariable)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key2')} {($ VSub_DollarName '$value2')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key2')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value two'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Second scope'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value one'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Variable from first scope'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (popScope)} {(DQ (${ VSub_Name env2))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env3 spids:[2205]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [2205] ) ] spids: [2205] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env3))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value one'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Variable from first scope post pop'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (hasValue)} {(DQ (${ VSub_Name env3))} {($ VSub_DollarName '$key2')} ) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(1)} {($ VSub_QMark '$?')} {(DQ ('Variable from second scope after we popped it'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (new)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env1 spids:[2316]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [2316] ) ] spids: [2316] ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setOrReplaceVariable)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key1')} {($ VSub_DollarName '$value1')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (pushScope)} {(DQ (${ VSub_Name env1))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env2 spids:[2351]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [2351] ) ] spids: [2351] ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setOrReplaceVariable)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key2')} {($ VSub_DollarName '$value2')} ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setOrReplaceVariable)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key1')} {($ VSub_DollarName '$value3')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key2')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value two'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Second scope'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value three'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Variable from first scope'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (popScope)} {(DQ (${ VSub_Name env2))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env3 spids:[2513]) op: Equal rhs: {(DQ (${ VSub_Name RESULT))} spids: [2513] ) ] spids: [2513] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env3))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value three'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('Variable from first scope post pop'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (hasValue)} {(DQ (${ VSub_Name env3))} {($ VSub_DollarName '$key2')} ) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(1)} {($ VSub_QMark '$?')} {(DQ ('Variable from second scope after we popped it'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (new)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env1 spids:[2626]) op: Equal rhs: {(DQ ($ VSub_DollarName '$RESULT'))} spids: [2626] ) ] spids: [2626] ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setVariable)} {($ VSub_DollarName '$env1')} {($ VSub_DollarName '$key1')} {($ VSub_DollarName '$value1')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (pushScope)} {(DQ (${ VSub_Name env1))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:env2 spids:[2655]) op: Equal rhs: {(DQ ($ VSub_DollarName '$RESULT'))} spids: [2655] ) ] spids: [2655] ) ] ) (C {(environment) (Lit_Other ':') (Lit_Other ':') (setVariable)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key1')} {($ VSub_DollarName '$value2')} ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env1))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value one'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('setVariable, original env'))} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {(environment) (Lit_Other ':') (Lit_Other ':') (getValue)} {(DQ (${ VSub_Name env2))} {($ VSub_DollarName '$key1')} ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(variable) (Lit_Other ':') (Lit_Other ':') (value)} {(DQ (${ VSub_Name RESULT))}) terminator: <Op_Semi ';'> ) (C {(assert) (Lit_Other ':') (Lit_Other ':') (equals)} {(DQ ('value two'))} {(DQ (${ VSub_Name RESULT))} {(DQ ('setVariable, new env'))} ) ] ) (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)}) spids: [2799 2803] ) } {(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)})] spids: [16777215 2825] ) ] spids: [16777215 2834] ) ] )