(CommandList
  children: [
    (Assignment
      keyword: Assign_Typeset
      flags: [-i]
      pairs: [(assign_pair lhs:(LhsName name:_Dbg_logging) op:Equal rhs:{(0)} spids:[75])]
      spids: [71]
    )
    (Assignment
      keyword: Assign_Typeset
      pairs: [
        (assign_pair
          lhs: (LhsName name:_Dbg_logging_file)
          op: Equal
          rhs: {(DQ (bashdb.txt))}
          spids: [84]
        )
      ]
      spids: [82]
    )
    (Assignment
      keyword: Assign_Typeset
      pairs: [(assign_pair lhs:(LhsName name:_Dbg_logging_overwrite) op:Equal rhs:{(0)} spids:[95])]
      spids: [93]
    )
    (Assignment
      keyword: Assign_Typeset
      pairs: [(assign_pair lhs:(LhsName name:_Dbg_logging_redirect) op:Equal rhs:{(0)} spids:[104])]
      spids: [102]
    )
    (FuncDef
      name: _Dbg_do_set_logging
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Typeset
              flags: [-a]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:args)
                  op: Equal
                  rhs: {(ArrayLiteralPart words:[{($ VSub_At '$@')}])}
                  spids: [119]
                )
              ]
              spids: [115]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_Great
                              left: 
                                (ArithWord
                                  w: 
                                    {
                                      (BracedVarSub
                                        token: <VSub_Name args>
                                        prefix_op: VSub_Pound
                                        bracket_op: (WholeArray op_id:Lit_At)
                                        spids: [129 135]
                                      )
                                    }
                                )
                              right: (ArithWord w:{(Lit_Digits 0)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Case
                      to_match: 
                        {
                          (BracedVarSub
                            token: <VSub_Name args>
                            bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                            spids: [151 156]
                          )
                        }
                      arms: [
                        (case_arm
                          pat_list: [{(off)}]
                          action: [
                            (If
                              arms: [
                                (if_arm
                                  cond: [
                                    (Sentence
                                      child: 
                                        (DParen
                                          child: 
                                            (ArithBinary
                                              op_id: Arith_NEqual
                                              left: (ArithVarRef name:_Dbg_logging)
                                              right: (ArithWord w:{(Lit_Digits 0)})
                                            )
                                        )
                                      terminator: <Op_Semi ';'>
                                    )
                                  ]
                                  action: [
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:_Dbg_logging)
                                          op: Equal
                                          rhs: {(0)}
                                          spids: [189]
                                        )
                                      ]
                                      spids: [189]
                                    )
                                  ]
                                  spids: [16777215 182]
                                )
                              ]
                              spids: [16777215 193]
                            )
                          ]
                          spids: [162 164 196 16777215]
                        )
                        (case_arm
                          pat_list: [{(on)}]
                          action: [
                            (If
                              arms: [
                                (if_arm
                                  cond: [
                                    (Sentence
                                      child: 
                                        (DParen
                                          child: 
                                            (ArithBinary
                                              op_id: Arith_DEqual
                                              left: (ArithVarRef name:_Dbg_logging)
                                              right: (ArithWord w:{(Lit_Digits 0)})
                                            )
                                        )
                                      terminator: <Op_Semi ';'>
                                    )
                                  ]
                                  action: [
                                    (Assignment
                                      keyword: Assign_None
                                      pairs: [
                                        (assign_pair
                                          lhs: (LhsName name:_Dbg_logging)
                                          op: Equal
                                          rhs: {(1)}
                                          spids: [222]
                                        )
                                      ]
                                      spids: [222]
                                    )
                                    (If
                                      arms: [
                                        (if_arm
                                          cond: [
                                            (Sentence
                                              child: 
                                                (DParen
                                                  child: (ArithVarRef name:_Dbg_logging_overwrite)
                                                )
                                              terminator: <Op_Semi ';'>
                                            )
                                          ]
                                          action: [
                                            (SimpleCommand
                                              words: [{(cat)} {(/dev/null)}]
                                              redirects: [
                                                (Redir
                                                  op_id: Redir_Great
                                                  fd: 16777215
                                                  arg_word: {($ VSub_Name '$_Dbg_logging_file')}
                                                  spids: [244]
                                                )
                                              ]
                                            )
                                          ]
                                          spids: [16777215 237]
                                        )
                                      ]
                                      spids: [16777215 248]
                                    )
                                  ]
                                  spids: [16777215 219]
                                )
                              ]
                              spids: [16777215 251]
                            )
                          ]
                          spids: [199 201 254 16777215]
                        )
                        (case_arm
                          pat_list: [{(overwrite)}]
                          action: [
                            (Assignment
                              keyword: Assign_Local
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:onoff)
                                  op: Equal
                                  rhs: 
                                    {
                                      (BracedVarSub
                                        token: <VSub_Number 2>
                                        suffix_op: 
                                          (StringUnary
                                            op_id: VTest_ColonHyphen
                                            arg_word: {(SQ <on>)}
                                          )
                                        spids: [265 271]
                                      )
                                    }
                                  spids: [264]
                                )
                              ]
                              spids: [262]
                            )
                            (Case
                              to_match: {($ VSub_Name '$onoff')}
                              arms: [
                                (case_arm
                                  pat_list: [{(on)} {(1)}]
                                  action: [
                                    (C {(_Dbg_write_journal_eval)} {(DQ ('_Dbg_logging_overwrite=1'))})
                                  ]
                                  spids: [282 288 299 16777215]
                                )
                                (case_arm
                                  pat_list: [{(off)} {(0)}]
                                  action: [
                                    (C {(_Dbg_write_journal_eval)} {(DQ ('_Dbg_logging_overwrite=0'))})
                                  ]
                                  spids: [302 308 318 16777215]
                                )
                                (case_arm
                                  pat_list: [{(Lit_Other '*')}]
                                  action: [
                                    (C {(_Dbg_msg)} 
                                      {
                                        (DQ (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (on) 
                                          (EscapedLiteralPart
                                            token: <Lit_EscapedChar '\\"'>
                                          ) (' or ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (off) 
                                          (EscapedLiteralPart
                                            token: <Lit_EscapedChar '\\"'>
                                          ) (' expected.')
                                        )
                                      }
                                    )
                                  ]
                                  spids: [321 323 16777215 340]
                                )
                              ]
                              spids: [274 278 340]
                            )
                          ]
                          spids: [257 259 343 16777215]
                        )
                        (case_arm
                          pat_list: [{(redirect)}]
                          action: [
                            (Assignment
                              keyword: Assign_Local
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:onoff)
                                  op: Equal
                                  rhs: 
                                    {
                                      (BracedVarSub
                                        token: <VSub_Number 2>
                                        suffix_op: 
                                          (StringUnary
                                            op_id: VTest_ColonHyphen
                                            arg_word: {(SQ <on>)}
                                          )
                                        spids: [354 360]
                                      )
                                    }
                                  spids: [353]
                                )
                              ]
                              spids: [351]
                            )
                            (Case
                              to_match: {($ VSub_Name '$onoff')}
                              arms: [
                                (case_arm
                                  pat_list: [{(on)} {(1)}]
                                  action: [
                                    (C {(_Dbg_write_journal_eval)} {(DQ ('_Dbg_logging_redirect=1'))})
                                  ]
                                  spids: [371 377 388 16777215]
                                )
                                (case_arm
                                  pat_list: [{(off)} {(0)}]
                                  action: [
                                    (C {(_Dbg_write_journal_eval)} {(DQ ('_Dbg_logging_redirect=0'))})
                                  ]
                                  spids: [391 397 407 16777215]
                                )
                                (case_arm
                                  pat_list: [{(Lit_Other '*')}]
                                  action: [
                                    (C {(_Dbg_msg)} 
                                      {
                                        (DQ (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (on) 
                                          (EscapedLiteralPart
                                            token: <Lit_EscapedChar '\\"'>
                                          ) (' or ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (off) 
                                          (EscapedLiteralPart
                                            token: <Lit_EscapedChar '\\"'>
                                          ) (' expected.')
                                        )
                                      }
                                    )
                                  ]
                                  spids: [410 412 16777215 429]
                                )
                              ]
                              spids: [363 367 429]
                            )
                          ]
                          spids: [346 348 432 16777215]
                        )
                        (case_arm
                          pat_list: [{(file)}]
                          action: [
                            (If
                              arms: [
                                (if_arm
                                  cond: [
                                    (Sentence
                                      child: 
                                        (DParen
                                          child: 
                                            (ArithBinary
                                              op_id: Arith_DEqual
                                              left: 
                                                (ArithWord
                                                  w: 
                                                    {
                                                      (BracedVarSub
                                                        token: <VSub_Name args>
                                                        prefix_op: VSub_Pound
                                                        bracket_op: (WholeArray op_id:Lit_At)
                                                        spids: [444 450]
                                                      )
                                                    }
                                                )
                                              right: (ArithWord w:{(Lit_Digits 2)})
                                            )
                                        )
                                      terminator: <Op_Semi ';'>
                                    )
                                  ]
                                  action: [
                                    (C {(_Dbg_write_journal_eval)} 
                                      {
                                        (DQ ('_Dbg_logging_file=') 
                                          (BracedVarSub
                                            token: <VSub_Name args>
                                            bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 1)}))
                                            spids: [468 473]
                                          )
                                        )
                                      }
                                    )
                                  ]
                                  spids: [16777215 461]
                                )
                              ]
                              else_action: [
                                (C {(_Dbg_msg)} 
                                  {(DQ ("Expecting a single file argument in 'set logging file'."))}
                                )
                              ]
                              spids: [477 488]
                            )
                          ]
                          spids: [435 437 491 16777215]
                        )
                        (case_arm
                          pat_list: [{(Lit_Other '*')}]
                          action: [
                            (C {(_Dbg_msg)} {(DQ ('Usage: set logging on'))})
                            (C {(_Dbg_msg)} {(DQ ('set logging off'))})
                            (C {(_Dbg_msg)} {(DQ ('set logging file FILENAME'))})
                            (C {(_Dbg_msg)} {(DQ ('set logging overwrite [on|off]'))})
                            (C {(_Dbg_msg)} {(DQ ('set logging redirect [on|off]'))})
                          ]
                          spids: [494 496 534 16777215]
                        )
                      ]
                      spids: [149 158 537]
                    )
                  ]
                  spids: [16777215 146]
                )
              ]
              spids: [16777215 540]
            )
            (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})
          ]
          spids: [112]
        )
      spids: [108 111]
    )
    (FuncDef
      name: _Dbg_do_show_logging
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Typeset
              flags: [-a]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:args)
                  op: Equal
                  rhs: {(ArrayLiteralPart words:[{($ VSub_Star '$*')}])}
                  spids: [561]
                )
              ]
              spids: [557]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_DEqual
                              left: 
                                (ArithWord
                                  w: 
                                    {
                                      (BracedVarSub
                                        token: <VSub_Name args>
                                        prefix_op: VSub_Pound
                                        bracket_op: (WholeArray op_id:Lit_At)
                                        spids: [571 577]
                                      )
                                    }
                                )
                              right: (ArithWord w:{(Lit_Digits 0)})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(_Dbg_msg)} 
                      {(DQ ('Future logs will be written to ') ($ VSub_Name '$_Dbg_logging_file'))}
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: (DParen child:(ArithVarRef name:_Dbg_logging_overwrite))
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [(C {(_Dbg_msg)} {(SQ <'Logs will overwrite the log file.'>)})]
                          spids: [16777215 610]
                        )
                      ]
                      else_action: [
                        (C {(_Dbg_msg)} {(SQ <'Logs will be appended to the log file.'>)})
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (Sentence
                                  child: (DParen child:(ArithVarRef name:_Dbg_logging_redirect))
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (C {(_Dbg_msg)} {(DQ ('Output will be sent only to the log file.'))})
                              ]
                              spids: [16777215 641]
                            )
                          ]
                          else_action: [(C {(_Dbg_msg)} {(DQ ('Output will be logged and displayed.'))})]
                          spids: [651 661]
                        )
                      ]
                      spids: [620 664]
                    )
                  ]
                  spids: [16777215 588]
                )
              ]
              else_action: [
                (Case
                  to_match: 
                    {
                      (BracedVarSub
                        token: <VSub_Name args>
                        bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                        spids: [672 677]
                      )
                    }
                  arms: [
                    (case_arm
                      pat_list: [{(overwrite)}]
                      action: [
                        (Assignment
                          keyword: Assign_Local
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:onoff)
                              op: Equal
                              rhs: {(DQ (off.))}
                              spids: [690]
                            )
                          ]
                          spids: [688]
                        )
                        (AndOr
                          ops: [Op_DAmp]
                          children: [
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_NEqual
                                  left: (ArithVarRef name:_Dbg_logging_overwrite)
                                  right: (ArithWord w:{(Lit_Digits 0)})
                                )
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:onoff)
                                  op: Equal
                                  rhs: {(SQ <on.>)}
                                  spids: [709]
                                )
                              ]
                              spids: [709]
                            )
                          ]
                        )
                        (C {(_Dbg_msg)} 
                          {
                            (DQ ('Whether logging overwrites or appends to the log file is ') 
                              (${ VSub_Name onoff)
                            )
                          }
                        )
                      ]
                      spids: [683 685 727 16777215]
                    )
                    (case_arm
                      pat_list: [{(redirect)}]
                      action: [
                        (Assignment
                          keyword: Assign_Local
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:onoff)
                              op: Equal
                              rhs: {(DQ (off.))}
                              spids: [737]
                            )
                          ]
                          spids: [735]
                        )
                        (AndOr
                          ops: [Op_DAmp]
                          children: [
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_NEqual
                                  left: (ArithVarRef name:_Dbg_logging_redirect)
                                  right: (ArithWord w:{(Lit_Digits 0)})
                                )
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:onoff)
                                  op: Equal
                                  rhs: {(SQ <on.>)}
                                  spids: [756]
                                )
                              ]
                              spids: [756]
                            )
                          ]
                        )
                        (C {(_Dbg_msg)} {(DQ ('The logging output mode is ') (${ VSub_Name onoff) (.))})
                      ]
                      spids: [730 732 773 16777215]
                    )
                    (case_arm
                      pat_list: [{(file)}]
                      action: [
                        (C {(_Dbg_msg)} 
                          {(DQ ('The current logfile is ') (${ VSub_Name _Dbg_logging_file))}
                        )
                      ]
                      spids: [776 778 791 16777215]
                    )
                    (case_arm
                      pat_list: [{(Lit_Other '*')}]
                      action: [
                        (C {(_Dbg_undefined_cmd)} {(DQ ('show logging'))} 
                          {
                            (DQ 
                              (BracedVarSub
                                token: <VSub_Name args>
                                bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)}))
                                spids: [806 811]
                              )
                            )
                          }
                        )
                      ]
                      spids: [794 796 815 16777215]
                    )
                  ]
                  spids: [670 679 818]
                )
              ]
              spids: [667 821]
            )
          ]
          spids: [554]
        )
      spids: [550 553]
    )
  ]
)