(CommandList children: [ (C {(_Dbg_help_add)} {(SQ <reverse>)} {(SQ <"?search\n"> <"\n"> <"Search backword and list line of a script.">)} ) (FuncDef name: _Dbg_do_reverse body: (BraceGroup children: [ (C {(typeset)} {(Lit_VarLike "delim_search_pat=") ($ VSub_Number "$1")}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Less left: (ArithWord w:{($ VSub_Pound "$#")}) right: (ArithWord w:{(Lit_Digits 1)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(_Dbg_errmsg)} {(DQ ("Need a search pattern"))}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 101] ) ] spids: [-1 116] ) (C {(shift)}) (Case to_match: {(DQ ($ VSub_Name "$delim_search_pat"))} arms: [ (case_arm pat_list: [{(Lit_Other "[") (Lit_Other "?") (Lit_Other "]")}] spids: [132 136 139 -1] ) (case_arm pat_list: [{(Lit_Other "[") (Lit_Other "?") (Lit_Other "]") (Lit_Other "*")}] action: [ (C {(typeset)} {(-a)} {(word)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:word) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(_Dbg_split)} {(SQ <"?">)} {($ VSub_Name "$delim_search_pat")} ) ] ) left_token: <Left_CommandSub "$("> spids: [159 167] ) } ] ) } spids: [157] ) ] spids: [157] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_Dbg_last_search_pat) op: Equal rhs: { (BracedVarSub token: <VSub_Name word> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [172 177] ) } spids: [171] ) ] spids: [171] ) ] spids: [142 147 180 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_Dbg_last_search_pat) op: Equal rhs: {($ VSub_Name "$delim_search_pat")} spids: [192] ) ] spids: [192] ) ] spids: [187 189 -1 196] ) ] spids: [123 129 196] ) (C {(typeset)} {(-i)} {(i)}) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:_Dbg_listline) right: (ArithWord w:{(Lit_Digits 1)}) ) ) cond: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:i) right: (ArithWord w:{(Lit_Digits 0)}) ) update: (UnaryAssign op_id:Node_PostDMinus child:(LhsName name:i)) body: (DoGroup children: [ (C {(_Dbg_get_source_line)} {($ VSub_Name "$i")} {(DQ ($ VSub_Name "$_Dbg_frame_last_filename"))} ) (C {(eval)} {(DQ ($ VSub_Name "$_seteglob"))}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name "$_Dbg_source_line")} right: {(Lit_Other "*") ($ VSub_Name "$_Dbg_last_search_pat") (Lit_Other "*") } ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(eval)} {(DQ ($ VSub_Name "$_resteglob"))}) (C {(_Dbg_do_list)} {($ VSub_Name "$i")} {(1)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_Dbg_listline) op: Equal rhs: {($ VSub_Name "$i")} spids: [285] ) ] spids: [285] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_Dbg_last_cmd) op: Equal rhs: {(SQ <search>)} spids: [289] ) ] spids: [289] ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] spids: [-1 268] ) ] spids: [-1 300] ) (C {(eval)} {(DQ ($ VSub_Name "$_resteglob"))}) ] spids: [233 310] ) ) (C {(_Dbg_msg)} {(DQ ("search pattern: ") ($ VSub_Name "$_Dbg_last_search_pat") (" not found."))} ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [77] ) spids: [73 76] ) (C {(_Dbg_help_add)} {(SQ <search>)} {(SQ <"/search/ -- Search forward and list line of a script.">)}) (FuncDef name: _Dbg_do_search body: (BraceGroup children: [ (C {(typeset)} {(Lit_VarLike "delim_search_pat=") (${ VSub_Number 1)}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Less left: (ArithWord w:{($ VSub_Pound "$#")}) right: (ArithWord w:{(Lit_Digits 1)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(_Dbg_errmsg)} {(DQ ("Need a search pattern"))}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 376] ) ] spids: [-1 391] ) (C {(shift)}) (C {(typeset)} {(search_pat)}) (Case to_match: {(DQ ($ VSub_Name "$delim_search_pat"))} arms: [ (case_arm pat_list:[{(/)}] spids:[411413416-1]) (case_arm pat_list: [{(/) (Lit_Other "*")}] action: [ (C {(typeset)} {(-a)} {(word)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:word) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(_Dbg_split)} {(SQ </>)} {($ VSub_Name "$delim_search_pat")} ) ] ) left_token: <Left_CommandSub "$("> spids: [434 442] ) } ] ) } spids: [432] ) ] spids: [432] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_Dbg_last_search_pat) op: Equal rhs: { (BracedVarSub token: <VSub_Name word> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [447 452] ) } spids: [446] ) ] spids: [446] ) ] spids: [419 422 455 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_Dbg_last_search_pat) op: Equal rhs: {($ VSub_Name "$delim_search_pat")} spids: [463] ) ] spids: [463] ) ] spids: [458 460 -1 467] ) ] spids: [402 408 467] ) (C {(typeset)} {(max_line)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:max_line) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(_Dbg_get_maxline)} {(DQ ($ VSub_Name "$_Dbg_frame_last_filename"))}) ] ) left_token: <Left_CommandSub "$("> spids: [477 483] ) } spids: [476] ) ] spids: [476] ) (C {(typeset)} {(-i)} {(i)}) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithBinary op_id: Arith_Plus left: (ArithVarRef name:_Dbg_listline) right: (ArithWord w:{(Lit_Digits 1)}) ) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithVarRef name:max_line) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (C {(_Dbg_get_source_line)} {($ VSub_Name "$i")} {(DQ ($ VSub_Name "$_Dbg_frame_last_filename"))} ) (C {(eval)} {(DQ ($ VSub_Name "$_seteglob"))}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name "$_Dbg_source_line")} right: {(Lit_Other "*") ($ VSub_Name "$_Dbg_last_search_pat") (Lit_Other "*") } ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(eval)} {(DQ ($ VSub_Name "$_resteglob"))}) (C {(_Dbg_do_list)} {($ VSub_Name "$i")} {(1)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_Dbg_listline) op: Equal rhs: {($ VSub_Name "$i")} spids: [573] ) ] spids: [573] ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] spids: [-1 556] ) ] spids: [-1 586] ) (C {(eval)} {(DQ ($ VSub_Name "$_resteglob"))}) ] spids: [521 596] ) ) (C {(_Dbg_errmsg)} {(DQ ("search pattern: ") ($ VSub_Name "$_Dbg_last_search_pat") (" not found."))} ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [350] ) spids: [346 349] ) ] )