(command.CommandList
  children: [
    (C {<cd>} 
      {
        (braced_var_sub
          token: <Id.VSub_Number 0>
          suffix_op: 
            (suffix_op.Unary
              tok: <Id.VOp1_Percent '%'>
              arg_word: {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>}
            )
        )
      }
    )
    (command.Simple
      words: [{<.>} {<'../JSON.sh'>}]
      redirects: [(redir op:<Id.Redir_Less '<'> loc:(redir_loc.Fd fd:0) arg:{<'/dev/null'>})]
      do_fork: T
    )
    (command.ShFunction
      name: ptest
      body: 
        (BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {<tokenize>})
                (command.Simple
                  words: [{<parse>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:fails) op:assign_op.Equal rhs:{<0>} spids:[45])]
    )
    (command.ShAssignment
      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:i) op:assign_op.Equal rhs:{<0>} spids:[48])]
    )
    (C {<echo>} {(DQ <1..4>)})
    (command.ForEach
      iter_name: input
      iter_words: [{(SQ <'"oooo"  '>)} {(SQ <'[true, 1, [0, {}]]  '>)} {(SQ <'{"true": 1}'>)}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:i)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: <Id.Lit_ArithVarLike i>
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [78]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Pipeline
                          children: [(C {<echo>} {(DQ ($ Id.VSub_DollarName '$input'))}) (C {<ptest>})]
                          negated: F
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'ok '> ($ Id.VSub_DollarName '$i') <' - '> ($ Id.VSub_DollarName '$input'))
                      }
                    )
                  ]
                  spids: [87 101]
                )
              ]
              else_action: [
                (C {<echo>} 
                  {
                    (DQ <'not ok '> ($ Id.VSub_DollarName '$i') <' - '> ($ Id.VSub_DollarName '$input'))
                  }
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:fails)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (word_part.ArithSub
                            anode: 
                              (arith_expr.Binary
                                op_id: Id.Arith_Plus
                                left: <Id.Lit_ArithVarLike fails>
                                right: {<Id.Lit_Digits 1>}
                              )
                          )
                        }
                      spids: [127]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  children: [
                    (command.Simple
                      words: [{<ptest>}]
                      redirects: [
                        (redir
                          op: <Id.Redir_Less '<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: {<'../package.json'>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  negated: T
                )
              ]
            )
          action: [
            (C {<echo>} {(DQ <'not ok 4 - Parsing package.json failed!'>)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:fails)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (word_part.ArithSub
                        anode: 
                          (arith_expr.Binary
                            op_id: Id.Arith_Plus
                            left: <Id.Lit_ArithVarLike fails>
                            right: {<Id.Lit_Digits 1>}
                          )
                      )
                    }
                  spids: [161]
                )
              ]
            )
          ]
          spids: [141 151]
        )
      ]
      else_action: [(C {<echo>} {(DQ <'ok '> ($ Id.VSub_DollarName '$i') <' - package.json'>)})]
    )
    (C {<echo>} {(DQ ($ Id.VSub_DollarName '$fails') <' test(s) failed'>)})
    (command.ControlFlow
      token: <Id.ControlFlow_Exit exit>
      arg_word: {($ Id.VSub_DollarName '$fails')}
    )
  ]
)