(command.CommandList children: [ (C {(source)} { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(dirname)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> ) (/reader.sh) } ) (C {(source)} { (word_part.CommandSubPart command_list: (command.CommandList children:[(C {(dirname)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> ) (/printer.sh) } ) (command.FuncDef name: READ body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_Other '[')} {(DQ (${ VSub_Number 1))} {(Lit_Other ']')}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) ] ) (C {(READLINE)}) ] ) (C {(READ_STR)} {(DQ (${ VSub_Name r))}) ] ) ) (command.FuncDef name: EVAL_AST body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ast) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) (assign_pair lhs: (lhs_expr.LhsName name:env) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.Sentence child: (C {(_obj_type)} {(DQ (${ VSub_Name ast))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(lhs_expr.LhsName name:ot) op:Equal rhs:{(DQ (${ VSub_Name r))})] ) (command.Case to_match: {(DQ (${ VSub_Name ot))} arms: [ (case_arm pat_list: [{(symbol)}] action: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:val) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Name ast))}) ) ) ) } ) ] ) (C {(eval)} {(Lit_VarLike 'r=') (DQ (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('{') (${ VSub_Name env) ('[') ) (${ VSub_Name val) (DQ (']}')) } ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_Other '[')} {(DQ (${ VSub_Name r))} {(Lit_Other ']')}) (C {(_error)} {(DQ ("'") (${ VSub_Name val) ("' not found"))}) ] ) ] ) (case_arm pat_list: [{(list)}] action: [ (C {(_map_with_type)} {(_list)} {(EVAL)} {(DQ (${ VSub_Name ast))} {(DQ (${ VSub_Name env))} ) ] ) (case_arm pat_list: [{(vector)}] action: [ (C {(_map_with_type)} {(_vector)} {(EVAL)} {(DQ (${ VSub_Name ast))} {(DQ (${ VSub_Name env))} ) ] ) (case_arm pat_list: [{(hash_map)}] action: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:res) op: Equal rhs: {(DQ )} ) (assign_pair lhs: (lhs_expr.LhsName name:key) op: Equal rhs: (word.EmptyWord) ) (assign_pair lhs: (lhs_expr.LhsName name:val) op: Equal rhs: {(DQ )} ) (assign_pair lhs: (lhs_expr.LhsName name:hm) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Name ast))}) ) ) ) } ) ] ) (command.Sentence child: (C {(_hash_map)}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:new_hm) op: Equal rhs: {(DQ (${ VSub_Name r))} ) ] ) (C {(eval)} {(Assign_Local local)} {(Lit_VarLike 'keys=') (DQ (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('{!') (${ VSub_Name hm) ('[@]}') ) } ) (command.ForEach iter_name: key iter_words: [{(${ VSub_Name keys)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(eval)} {(Lit_VarLike 'val=') (DQ (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('{') (${ VSub_Name hm) ('[') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (${ VSub_Name key) (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) (']}') ) } ) (C {(EVAL)} {(DQ (${ VSub_Name val))} {(DQ (${ VSub_Name env))}) (C {(_assoc) (KW_Bang '!')} {(DQ (${ VSub_Name new_hm))} {(DQ (${ VSub_Name key))} {(DQ (${ VSub_Name r))} ) ] ) ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: {(DQ (${ VSub_Name new_hm))} ) ] ) ] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: {(DQ (${ VSub_Name ast))} ) ] ) ] ) ] ) ] ) ) (command.FuncDef name: EVAL body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ast) op: Equal rhs: {(DQ (${ VSub_Number 1))} ) (assign_pair lhs: (lhs_expr.LhsName name:env) op: Equal rhs: {(DQ (${ VSub_Number 2))} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:r) op:Equal rhs:(word.EmptyWord))] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.WordTest w:{(DQ (${ VSub_Name __ERROR))}) ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (command.Sentence child: (C {(_obj_type)} {(DQ (${ VSub_Name ast))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(lhs_expr.LhsName name:ot) op:Equal rhs:{(DQ (${ VSub_Name r))})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name ot))} right: {(DQ (list))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(EVAL_AST)} {(DQ (${ VSub_Name ast))} {(DQ (${ VSub_Name env))}) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(_empty) (Lit_Other '?')} {(DQ (${ VSub_Name ast))}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: {(DQ (${ VSub_Name ast))} ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) (C {(EVAL_AST)} {(DQ (${ VSub_Name ast))} {(DQ (${ VSub_Name env))}) (command.AndOr ops: [Op_DAmp] children: [ (command.DBracket expr: (bool_expr.WordTest w:{(DQ (${ VSub_Name __ERROR))}) ) (command.ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (command.Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(lhs_expr.LhsName name:el) op:Equal rhs:{(DQ (${ VSub_Name r))})] ) (command.Sentence child: (C {(_first)} {(DQ (${ VSub_Name el))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(lhs_expr.LhsName name:f) op:Equal rhs:{(DQ (${ VSub_Name r))})] ) (command.Sentence child: (C {(_rest)} {(DQ (${ VSub_Name el))}) terminator: <Op_Semi ';'> ) (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:args) op: Equal rhs: { (DQ (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Name r))}) ) ) ) } ) ] ) (C {(eval)} {(${ VSub_Name f)} {(${ VSub_Name args)}) ] ) ) (command.FuncDef name: PRINT body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr:(bool_expr.WordTest w:{(DQ (${ VSub_Name __ERROR))})) terminator: <Op_Semi ';'> ) ] action: [ (C {(_pr_str)} {(DQ (${ VSub_Name __ERROR))} {(yes)}) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: {(DQ ('Error: ') (${ VSub_Name r))} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:__ERROR) op:Equal rhs:(word.EmptyWord))] ) ] ) ] else_action: [(C {(_pr_str)} {(DQ (${ VSub_Number 1))} {(yes)})] ) ] ) ) (command.Assignment keyword: Assign_Declare flags: [-A] pairs: [(assign_pair lhs:(lhs_expr.LhsName name:REPL_ENV) op:Equal)] ) (command.FuncDef name: REP body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:r) op:Equal rhs:(word.EmptyWord))] ) (C {(READ)} {(DQ (${ VSub_Number 1))}) (C {(EVAL)} {(DQ (${ VSub_Name r))} {(REPL_ENV)}) (C {(PRINT)} {(DQ (${ VSub_Name r))}) ] ) ) (command.FuncDef name: plus body: (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Plus left: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 1))}) ) ) } ) right: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 2))}) ) ) } ) ) ) } ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(_number)} {(DQ (${ VSub_Name r))}) terminator: <Op_Semi ';'> ) ] ) ) (command.FuncDef name: minus body: (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 1))}) ) ) } ) right: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 2))}) ) ) } ) ) ) } ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(_number)} {(DQ (${ VSub_Name r))}) terminator: <Op_Semi ';'> ) ] ) ) (command.FuncDef name: multiply body: (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Star left: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 1))}) ) ) } ) right: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 2))}) ) ) } ) ) ) } ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(_number)} {(DQ (${ VSub_Name r))}) terminator: <Op_Semi ';'> ) ] ) ) (command.FuncDef name: divide body: (command.BraceGroup children: [ (command.Sentence child: (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:r) op: Equal rhs: { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Slash left: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 1))}) ) ) } ) right: (arith_expr.ArithWord w: { (word_part.BracedVarSub token: <VSub_Name ANON> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(DQ (${ VSub_Number 2))}) ) ) } ) ) ) } ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (C {(_number)} {(DQ (${ VSub_Name r))}) terminator: <Op_Semi ';'> ) ] ) ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name:REPL_ENV index:(arith_expr.ArithWord w:{(DQ ('+'))})) op: Equal rhs: {(plus)} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name:REPL_ENV index:(arith_expr.ArithWord w:{(DQ (-))})) op: Equal rhs: {(minus)} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name:REPL_ENV index:(arith_expr.ArithWord w:{(DQ (__STAR__))})) op: Equal rhs: {(multiply)} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsIndexedName name:REPL_ENV index:(arith_expr.ArithWord w:{(DQ (/))})) op: Equal rhs: {(divide)} ) ] ) (command.WhileUntil keyword: <KW_While while> cond: [(command.Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)] body: (command.DoGroup children: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(READLINE)} {(DQ ('user> '))}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(DQ ($ VSub_QMark '$?'))} ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.DBracket expr:(bool_expr.WordTest w:{(DQ (${ VSub_Name r))})) (C {(REP)} {(DQ (${ VSub_Name r))}) (C {(echo)} {(DQ (${ VSub_Name r))}) ] ) ] ) ) ] )