(command.CommandList
  children: [
    (C {<Id.KW_Set set>} {<-eu>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:WARNING)
          op: assign_op.Equal
          rhs: {(SQ <'\\033[0;31m'>)}
          spids: [12]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SUCCESS)
          op: assign_op.Equal
          rhs: {(SQ <'\\033[0;32m'>)}
          spids: [17]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:INFO)
          op: assign_op.Equal
          rhs: {(SQ )}
          spids: [22]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DEBUG)
          op: assign_op.Equal
          rhs: {(SQ )}
          spids: [26]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:RESET)
          op: assign_op.Equal
          rhs: {(SQ <'\\033[0m'>)}
          spids: [30]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:VERBOSE)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name VERBOSE>
                suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{})
              )
            }
          spids: [35]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:DIR)
          op: assign_op.Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (C {<cd>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<dirname>} 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  token: <Id.VSub_Name BASH_SOURCE>
                                                  bracket_op: 
                                                    (bracket_op.ArrayIndex
                                                      expr: 
                                                        (arith_expr.ArithWord
                                                          w: {<Id.Lit_Digits 0>}
                                                        )
                                                    )
                                                )
                                              )
                                            }
                                          )
                                        ]
                                      )
                                  )
                                )
                              }
                            )
                            (C {<pwd>})
                          ]
                        )
                      ]
                    )
                )
              )
            }
          spids: [42]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:REFMT)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName '$DIR') </../refmt_impl.native>)}
          spids: [73]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (command.DBracket expr:(bool_expr.Unary op_id:Id.BoolUnary_f child:{<REFMT>}))
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (command.Simple
              words: [{<echo>} {(DQ <'Cannot find refmt at '> ($ Id.VSub_DollarName '$REFMT'))}]
              redirects: [(redir op:<Id.Redir_GreatAnd '1>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
            )
            (command.Sentence
              child: (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              terminator: <Id.Op_Semi _>
            )
          ]
          spids: [80 91]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:UNIT_TEST_INPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </unit_tests/input>}
          spids: [113]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:UNIT_TEST_OUTPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </unit_tests/actual_output>}
          spids: [118]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:UNIT_TEST_EXPECTED_OUTPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </unit_tests/expected_output>}
          spids: [123]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TYPE_TEST_INPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </typeCheckedTests/input>}
          spids: [129]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TYPE_TEST_OUTPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </typeCheckedTests/actual_output>}
          spids: [134]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:TYPE_TEST_EXPECTED_OUTPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </typeCheckedTests/expected_output>}
          spids: [139]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ERROR_TEST_INPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </errorTests/input>}
          spids: [145]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ERROR_TEST_OUTPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </errorTests/actual_output>}
          spids: [150]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:ERROR_TEST_EXPECTED_OUTPUT)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </errorTests/expected_output>}
          spids: [155]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:FAILED_TESTS)
          op: assign_op.Equal
          rhs: {($ Id.VSub_DollarName '$DIR') </failed_tests>}
          spids: [161]
        )
      ]
    )
    (command.ShFunction
      name: info
      body: 
        (command.BraceGroup
          children: [
            (C {<printf>} 
              {
                (DQ (${ Id.VSub_Name INFO) ($ Id.VSub_Number '$1') (${ Id.VSub_Name RESET) 
                  <Id.Lit_Other '\\'> <n>
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: debug
      body: 
        (command.BraceGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-z>} 
                          {(DQ ($ Id.VSub_DollarName '$VERBOSE'))} {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<printf>} 
                      {
                        (DQ (${ Id.VSub_Name DEBUG) ($ Id.VSub_Number '$1') (${ Id.VSub_Name RESET) 
                          <Id.Lit_Other '\\'> <n>
                        )
                      }
                    )
                  ]
                  spids: [201 216]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: success
      body: 
        (command.BraceGroup
          children: [
            (C {<printf>} 
              {
                (DQ (${ Id.VSub_Name SUCCESS) ($ Id.VSub_Number '$1') (${ Id.VSub_Name RESET) 
                  <Id.Lit_Other '\\'> <n>
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: output
      body: 
        (command.BraceGroup
          children: [(C {<printf>} {(DQ ($ Id.VSub_Number '$1') <Id.Lit_Other '\\'> <n>)})]
        )
    )
    (command.ShFunction
      name: warning
      body: 
        (command.BraceGroup
          children: [
            (C {<printf>} 
              {
                (DQ (${ Id.VSub_Name WARNING) ($ Id.VSub_Number '$1') (${ Id.VSub_Name RESET) 
                  <Id.Lit_Other '\\'> <n>
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: setup_test_dir
      body: 
        (command.BraceGroup
          children: [
            (C {<echo>} 
              {(DQ <"Setting up test dirs actual_output alongside the tests' expected_output">)}
            )
            (C {<mkdir>} {<-p>} {($ Id.VSub_DollarName '$UNIT_TEST_OUTPUT')} 
              {($ Id.VSub_DollarName '$TYPE_TEST_OUTPUT')} {($ Id.VSub_DollarName '$ERROR_TEST_OUTPUT')}
            )
            (C {<touch>} {($ Id.VSub_DollarName '$FAILED_TESTS')})
          ]
        )
    )
    (C {<setup_test_dir>})
    (C {<Id.KW_Set set>} {<Id.Lit_Other '+'> <e>})
    (command.ShFunction
      name: stdin_test
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:INPUT_FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [363]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OUTPUT_FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [367]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:EXPECTED_OUTPUT_FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$3')}
                  spids: [371]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:HEURISTICS_FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$4')}
                  spids: [379]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILENAME)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<basename>} {($ Id.VSub_DollarName '$INPUT_FILE')})]
                          )
                      )
                    }
                  spids: [384]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILEEXT)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name FILENAME>
                          suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPound arg_word:{<'*.'>})
                        )
                      )
                    }
                  spids: [392]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobEqual
                              left: {($ Id.VSub_DollarName '$FILEEXT')}
                              right: {(DQ <re>)}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Pipeline
                      children: [
                        (C {<cat>} {($ Id.VSub_DollarName '$INPUT_FILE')})
                        (command.Simple
                          words: [
                            {($ Id.VSub_DollarName '$REFMT')}
                            {<-is-interface-pp>}
                            {<false>}
                            {<-print-width>}
                            {<50>}
                            {<-parse>}
                            {<re>}
                            {<-print>}
                            {<re>}
                            {<-use-stdin>}
                            {<true>}
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_GreatAnd '2>&'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<1>}
                            )
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {($ Id.VSub_DollarName '$OUTPUT_FILE')}
                            )
                          ]
                        )
                      ]
                      negated: F
                    )
                  ]
                  spids: [403 418]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobEqual
                              left: {($ Id.VSub_DollarName '$FILEEXT')}
                              right: {(DQ <rei>)}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Pipeline
                      children: [
                        (C {<cat>} {($ Id.VSub_DollarName '$INPUT_FILE')})
                        (command.Simple
                          words: [
                            {($ Id.VSub_DollarName '$REFMT')}
                            {<-is-interface-pp>}
                            {<true>}
                            {<-print-width>}
                            {<50>}
                            {<-parse>}
                            {<re>}
                            {<-print>}
                            {<re>}
                            {<-use-stdin>}
                            {<true>}
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_GreatAnd '2>&'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<1>}
                            )
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {($ Id.VSub_DollarName '$OUTPUT_FILE')}
                            )
                          ]
                        )
                      ]
                      negated: F
                    )
                  ]
                  spids: [457 472]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobEqual
                              left: {($ Id.VSub_DollarName '$FILEEXT')}
                              right: {(DQ <ml>)}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Pipeline
                      children: [
                        (C {<cat>} {($ Id.VSub_DollarName '$INPUT_FILE')})
                        (command.Simple
                          words: [
                            {($ Id.VSub_DollarName '$REFMT')}
                            {<-heuristics-file>}
                            {($ Id.VSub_DollarName '$HEURISTICS_FILE')}
                            {<-is-interface-pp>}
                            {<false>}
                            {<-print-width>}
                            {<50>}
                            {<-parse>}
                            {<ml>}
                            {<-print>}
                            {<re>}
                            {<-use-stdin>}
                            {<true>}
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_GreatAnd '2>&'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<1>}
                            )
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {($ Id.VSub_DollarName '$OUTPUT_FILE')}
                            )
                          ]
                        )
                      ]
                      negated: F
                    )
                  ]
                  spids: [511 526]
                )
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobEqual
                              left: {($ Id.VSub_DollarName '$FILEEXT')}
                              right: {(DQ <mli>)}
                            )
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.Pipeline
                      children: [
                        (C {<cat>} {($ Id.VSub_DollarName '$INPUT_FILE')})
                        (command.Simple
                          words: [
                            {($ Id.VSub_DollarName '$REFMT')}
                            {<-heuristics-file>}
                            {($ Id.VSub_DollarName '$HEURISTICS_FILE')}
                            {<-is-interface-pp>}
                            {<true>}
                            {<-print-width>}
                            {<50>}
                            {<-parse>}
                            {<ml>}
                            {<-print>}
                            {<re>}
                            {<-use-stdin>}
                            {<true>}
                          ]
                          redirects: [
                            (redir
                              op: <Id.Redir_GreatAnd '2>&'>
                              loc: (redir_loc.Fd fd:2)
                              arg: {<1>}
                            )
                            (redir
                              op: <Id.Redir_Great '>'>
                              loc: (redir_loc.Fd fd:1)
                              arg: {($ Id.VSub_DollarName '$OUTPUT_FILE')}
                            )
                          ]
                        )
                      ]
                      negated: F
                    )
                  ]
                  spids: [569 584]
                )
              ]
              else_action: [
                (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED -use-stdin '> <Id.Lit_Other '\\'> <n>)})
                (C {<info>} 
                  {
                    (DQ <'  Cannot determine default implementation parser for extension '> 
                      (${ Id.VSub_Name FILEEXT)
                    )
                  }
                )
                (command.ControlFlow
                  token: <Id.ControlFlow_Return return>
                  arg_word: {<1>}
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED -use-stdin '> <Id.Lit_Other '\\'> <n>)})
                    (C {<info>} {(DQ <'  There was an error when testing -use-stdin'>)})
                    (C {<info>} {(DQ <'  for input file '> ($ Id.VSub_DollarName '$INPUT_FILE'))})
                    (C {<info>} 
                      {
                        (DQ <'  and output file '> ($ Id.VSub_DollarName '$OUTPUT_FILE') 
                          (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (C {<echo>} {(DQ )})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [658 673]
                )
              ]
            )
            (C {<debug>} 
              {
                (DQ <'  Comparing -use-stdin results:  diff '> ($ Id.VSub_DollarName '$OUTPUT_FILE') 
                  <' '> ($ Id.VSub_DollarName '$EXPECTED_OUTPUT_FILE')
                )
              }
            )
            (C {<diff>} {<--unchanged-line-format> <Id.Lit_Equals '='> (DQ )} 
              {<--new-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} {<--old-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} {($ Id.VSub_DollarName '$OUTPUT_FILE')} 
              {($ Id.VSub_DollarName '$EXPECTED_OUTPUT_FILE')}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED -use-stdin '> <Id.Lit_Other '\\'> <n>)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) ($ Id.VSub_DollarName '$OUTPUT_FILE') 
                          (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (C {<info>} {(DQ <"  doesn't match expected output">)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) 
                          ($ Id.VSub_DollarName '$EXPECTED_OUTPUT_FILE') (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (C {<echo>} {(DQ )})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [761 776]
                )
              ]
            )
            (command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<0>})
          ]
        )
    )
    (command.ShFunction
      name: unit_test
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [853]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:INPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [857]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OUTPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$3')}
                  spids: [861]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:EXPECTED_OUTPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$4')}
                  spids: [865]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILENAME)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                          )
                      )
                    }
                  spids: [870]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILEEXT)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name FILENAME>
                          suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPound arg_word:{<'*.'>})
                        )
                      )
                    }
                  spids: [878]
                )
              ]
            )
            (C {<info>} {(DQ <'Unit Test: '> ($ Id.VSub_DollarName '$FILE'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.mli>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<basename>} {($ Id.VSub_DollarName '$FILE')})
                                            ]
                                          )
                                      )
                                    )
                                  } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                            ]
                                          )
                                      )
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:REFILE)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          command_list: 
                                            (command.CommandList
                                              children: [
                                                (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                              ]
                                            )
                                        ) <.re>
                                      )
                                    }
                                  spids: [986]
                                )
                              ]
                            )
                          ]
                          spids: [955 983]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:REFILE)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.mli>})
                                          ]
                                        )
                                    ) <.rei>
                                  )
                                }
                              spids: [1002]
                            )
                          ]
                        )
                      ]
                    )
                    (C {<debug>} 
                      {
                        (DQ ($ Id.VSub_DollarName '$REFMT') <' -heuristics-file '> 
                          ($ Id.VSub_DollarName '$INPUT') <'/arity.txt -print-width 50 -print re '> ($ Id.VSub_DollarName '$INPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$REFILE')
                        )
                      }
                    )
                    (command.Simple
                      words: [
                        {($ Id.VSub_DollarName '$REFMT')}
                        {<-heuristics-file>}
                        {($ Id.VSub_DollarName '$INPUT') </arity.txt>}
                        {<-print-width>}
                        {<50>}
                        {<-print>}
                        {<re>}
                        {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE')}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$REFILE')}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<warning>} 
                              {
                                (DQ <'  \xe2\x8a\x98 TEST FAILED CONVERTING ML TO RE'> 
                                  <Id.Lit_Other '\\'> <n>
                                )
                              }
                            )
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [1064 1079]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:FILE)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$REFILE')}
                          spids: [1099]
                        )
                      ]
                    )
                  ]
                  spids: [897 952]
                )
              ]
              else_action: [
                (C {<debug>} 
                  {
                    (DQ <"  '"> ($ Id.VSub_DollarName '$REFMT') <' -print-width 50 -print re '> 
                      ($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> ($ Id.VSub_DollarName '$OUTPUT') </> 
                      ($ Id.VSub_DollarName '$FILE') <"'">
                    )
                  }
                )
                (command.Simple
                  words: [
                    {($ Id.VSub_DollarName '$REFMT')}
                    {<-print-width>}
                    {<50>}
                    {<-print>}
                    {<re>}
                    {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE')}
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
                    )
                  ]
                )
              ]
            )
            (C {<debug>} 
              {
                (DQ <'  Comparing results:  diff '> ($ Id.VSub_DollarName '$OUTPUT') </> 
                  ($ Id.VSub_DollarName '$FILE') <' '> ($ Id.VSub_DollarName '$EXPECTED_OUTPUT') </> ($ Id.VSub_DollarName '$FILE')
                )
              }
            )
            (C {<diff>} {<--unchanged-line-format> <Id.Lit_Equals '='> (DQ )} 
              {<--new-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} {<--old-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} 
              {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} {($ Id.VSub_DollarName '$EXPECTED_OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED'> <Id.Lit_Other '\\'> <n>)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) ($ Id.VSub_DollarName '$OUTPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (C {<info>} {(DQ <"  doesn't match expected output">)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) ($ Id.VSub_DollarName '$EXPECTED_OUTPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (C {<echo>} {(DQ )})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1195 1210]
                )
              ]
            )
            (C {<debug>} {(DQ <'Testing -use-stdin'>)})
            (C {<stdin_test>} {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_Number '$1')} 
              {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} {($ Id.VSub_DollarName '$EXPECTED_OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} 
              {($ Id.VSub_DollarName '$INPUT') </arity.txt>}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                  spids: [1302 1317]
                )
              ]
              else_action: [(C {<success>} {(DQ <'  \xe2\x98\x91 PASS'>)}) (C {<echo>})]
            )
          ]
        )
    )
    (command.ShFunction
      name: idempotent_test
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [1352]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:INPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [1356]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OUTPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$3')}
                  spids: [1360]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILENAME)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                          )
                      )
                    }
                  spids: [1365]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILEEXT)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Name FILENAME>
                          suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPound arg_word:{<'*.'>})
                        )
                      )
                    }
                  spids: [1373]
                )
              ]
            )
            (C {<info>} {(DQ <'Idempotent Test: '> ($ Id.VSub_DollarName '$FILE'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.mli>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<basename>} {($ Id.VSub_DollarName '$FILE')})
                                            ]
                                          )
                                      )
                                    )
                                  } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                            ]
                                          )
                                      )
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:REFILE)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          command_list: 
                                            (command.CommandList
                                              children: [
                                                (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                              ]
                                            )
                                        ) <.re>
                                      )
                                    }
                                  spids: [1481]
                                )
                              ]
                            )
                          ]
                          spids: [1450 1478]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:REFILE)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.mli>})
                                          ]
                                        )
                                    ) <.rei>
                                  )
                                }
                              spids: [1497]
                            )
                          ]
                        )
                      ]
                    )
                    (C {<debug>} 
                      {
                        (DQ <'  Converting '> ($ Id.VSub_DollarName '$FILE') <' to '> 
                          ($ Id.VSub_DollarName '$REFILE') <':'>
                        )
                      }
                    )
                    (C {<debug>} 
                      {
                        (DQ <'  Formatting Once: '> ($ Id.VSub_DollarName '$REFMT') 
                          <' -heuristics-file '> ($ Id.VSub_DollarName '$INPUT') <'/arity.txt -print-width 50 -print re '> 
                          ($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> ($ Id.VSub_DollarName '$OUTPUT') </> 
                          ($ Id.VSub_DollarName '$REFILE')
                        )
                      }
                    )
                    (command.Simple
                      words: [
                        {($ Id.VSub_DollarName '$REFMT')}
                        {<-heuristics-file>}
                        {($ Id.VSub_DollarName '$INPUT') </arity.txt>}
                        {<-print-width>}
                        {<50>}
                        {<-print>}
                        {<re>}
                        {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE')}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$REFILE')}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<warning>} {(DQ <'\xe2\x8a\x98 FAILED'> <Id.Lit_Other '\\'> <n>)})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [1572 1587]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:FILE)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$REFILE')}
                          spids: [1607]
                        )
                      ]
                    )
                    (C {<debug>} 
                      {
                        (DQ <'  Generating output again: '> ($ Id.VSub_DollarName '$REFMT') 
                          <' -print-width 50 -print re '> ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> 
                          ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') <.formatted>
                        )
                      }
                    )
                    (command.Simple
                      words: [
                        {($ Id.VSub_DollarName '$REFMT')}
                        {<-print-width>}
                        {<50>}
                        {<-print>}
                        {<re>}
                        {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: 
                            {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') 
                              <.formatted>
                            }
                        )
                      ]
                    )
                  ]
                  spids: [1392 1447]
                )
              ]
              else_action: [
                (C {<debug>} 
                  {
                    (DQ <"  Formatting Once: '"> ($ Id.VSub_DollarName '$REFMT') 
                      <' -print-width 50 -print re '> ($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> 
                      ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') <"'">
                    )
                  }
                )
                (command.Simple
                  words: [
                    {($ Id.VSub_DollarName '$REFMT')}
                    {<-print-width>}
                    {<50>}
                    {<-print>}
                    {<re>}
                    {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE')}
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
                    )
                  ]
                )
                (C {<debug>} 
                  {
                    (DQ <'  Generating output again: '> ($ Id.VSub_DollarName '$REFMT') 
                      <' -print-width 50 -print re '> ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> 
                      ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') <.formatted>
                    )
                  }
                )
                (command.Simple
                  words: [
                    {($ Id.VSub_DollarName '$REFMT')}
                    {<-print-width>}
                    {<50>}
                    {<-print>}
                    {<re>}
                    {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: 
                        {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') 
                          <.formatted>
                        }
                    )
                  ]
                )
              ]
            )
            (C {<diff>} {<--unchanged-line-format> <Id.Lit_Equals '='> (DQ )} 
              {<--new-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} {<--old-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} 
              {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') <.formatted>}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<warning>} {(DQ <'\xe2\x8a\x98 FAILED'> <Id.Lit_Other '\\'> <n>)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) ($ Id.VSub_DollarName '$OUTPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') <.formatted> (${ Id.VSub_Name RESET) <Id.Lit_Other '\\'> <n>
                        )
                      }
                    )
                    (C {<info>} {(DQ <'  is not same as'>)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) ($ Id.VSub_DollarName '$OUTPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [1773 1788]
                )
              ]
            )
            (C {<debug>} {(DQ <'Testing -use-stdin'>)})
            (C {<stdin_test>} {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_Number '$1')} 
              {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} 
              {($ Id.VSub_DollarName '$INPUT') </arity.txt>}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [(command.ControlFlow token:<Id.ControlFlow_Return return> arg_word:{<1>})]
                  spids: [1877 1892]
                )
              ]
              else_action: [
                (C {<stdin_test>} {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} 
                  {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE') <.formatted>} {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} 
                  {($ Id.VSub_DollarName '$INPUT') </arity.txt>}
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_eq
                                      left: {($ Id.VSub_QMark '$?')}
                                      right: {<0>}
                                    )
                                )
                              ]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                      spids: [1922 1937]
                    )
                  ]
                  else_action: [(C {<success>} {(DQ <'  \xe2\x98\x91 PASS'>)}) (C {<echo>})]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: typecheck_test
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [1975]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:INPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [1979]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OUTPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$3')}
                  spids: [1983]
                )
              ]
            )
            (C {<info>} {(DQ <'Typecheck Test: '> ($ Id.VSub_DollarName '$FILE'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.mli>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {<Id.Lit_LBracket '['>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<basename>} {($ Id.VSub_DollarName '$FILE')})
                                            ]
                                          )
                                      )
                                    )
                                  } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                                  {
                                    (DQ 
                                      (command_sub
                                        left_token: <Id.Left_DollarParen '$('>
                                        command_list: 
                                          (command.CommandList
                                            children: [
                                              (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                            ]
                                          )
                                      )
                                    )
                                  } {<Id.Lit_RBracket ']'>}
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:REFILE)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (command_sub
                                          left_token: <Id.Left_DollarParen '$('>
                                          command_list: 
                                            (command.CommandList
                                              children: [
                                                (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                              ]
                                            )
                                        ) <.re>
                                      )
                                    }
                                  spids: [2085]
                                )
                              ]
                            )
                          ]
                          spids: [2054 2082]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [
                            (assign_pair
                              lhs: (sh_lhs_expr.Name name:REFILE)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (DQ 
                                    (command_sub
                                      left_token: <Id.Left_DollarParen '$('>
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.mli>})
                                          ]
                                        )
                                    ) <.rei>
                                  )
                                }
                              spids: [2101]
                            )
                          ]
                        )
                      ]
                    )
                    (C {<debug>} 
                      {
                        (DQ <'  Converting '> ($ Id.VSub_DollarName '$FILE') <' to '> 
                          ($ Id.VSub_DollarName '$REFILE') <':'>
                        )
                      }
                    )
                    (C {<debug>} 
                      {
                        (DQ ($ Id.VSub_DollarName '$REFMT') <' -heuristics-file '> 
                          ($ Id.VSub_DollarName '$INPUT') <'/arity.txt -print-width 50 -print re '> ($ Id.VSub_DollarName '$INPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$REFILE')
                        )
                      }
                    )
                    (command.Simple
                      words: [
                        {($ Id.VSub_DollarName '$REFMT')}
                        {<-heuristics-file>}
                        {($ Id.VSub_DollarName '$INPUT') </arity.txt>}
                        {<-print-width>}
                        {<50>}
                        {<-print>}
                        {<re>}
                        {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE')}
                      ]
                      redirects: [
                        (redir
                          op: <Id.Redir_GreatAnd '2>&'>
                          loc: (redir_loc.Fd fd:2)
                          arg: {<1>}
                        )
                        (redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$REFILE')}
                        )
                      ]
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED'> <Id.Lit_Other '\\'> <n>)})
                            (command.ControlFlow
                              token: <Id.ControlFlow_Return return>
                              arg_word: {<1>}
                            )
                          ]
                          spids: [2174 2189]
                        )
                      ]
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:FILE)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$REFILE')}
                          spids: [2209]
                        )
                      ]
                    )
                  ]
                  spids: [1996 2051]
                )
              ]
              else_action: [
                (C {<debug>} 
                  {
                    (DQ <'  Formatting: '> ($ Id.VSub_DollarName '$REFMT') 
                      <' -print-width 50 -print re '> ($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE') <' 2>&1 > '> 
                      ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')
                    )
                  }
                )
                (command.Simple
                  words: [
                    {($ Id.VSub_DollarName '$REFMT')}
                    {<-print-width>}
                    {<50>}
                    {<-print>}
                    {<re>}
                    {($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE')}
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_GreatAnd '2>&'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<1>}
                    )
                    (redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
                    )
                  ]
                )
                (command.If
                  arms: [
                    (if_arm
                      cond: [
                        (command.Sentence
                          child: 
                            (command.Pipeline
                              children: [
                                (command.DBracket
                                  expr: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_eq
                                      left: {($ Id.VSub_QMark '$?')}
                                      right: {<0>}
                                    )
                                )
                              ]
                              negated: T
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                      action: [
                        (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED'> <Id.Lit_Other '\\'> <n>)})
                        (command.ControlFlow
                          token: <Id.ControlFlow_Return return>
                          arg_word: {<1>}
                        )
                      ]
                      spids: [2256 2271]
                    )
                  ]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {<Id.Lit_LBracket '['>} 
                          {
                            (DQ 
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                  )
                              )
                            )
                          } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                          {
                            (DQ 
                              (command_sub
                                left_token: <Id.Left_DollarParen '$('>
                                command_list: 
                                  (command.CommandList
                                    children: [
                                      (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.re>})
                                    ]
                                  )
                              )
                            )
                          } {<Id.Lit_RBracket ']'>}
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPILE_FLAGS)
                          op: assign_op.Equal
                          rhs: {(DQ <'-intf-suffix .rei -impl'>)}
                          spids: [2325]
                        )
                      ]
                    )
                  ]
                  spids: [2294 2322]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:COMPILE_FLAGS)
                      op: assign_op.Equal
                      rhs: {(DQ <-intf>)}
                      spids: [2334]
                    )
                  ]
                )
              ]
            )
            (C {<debug>} 
              {
                (DQ <'  Compiling: ocamlc -c -pp '> ($ Id.VSub_DollarName '$REFMT') <' '> 
                  ($ Id.VSub_DollarName '$COMPILE_FLAGS') <' '> ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')
                )
              }
            )
            (C {<ocamlc>} {<-c>} {<-pp>} {($ Id.VSub_DollarName '$REFMT')} 
              {($ Id.VSub_DollarName '$COMPILE_FLAGS')} {(DQ ($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE'))}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED'> <Id.Lit_Other '\\'> <n>)})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [2375 2390]
                )
              ]
            )
            (C {<success>} {(DQ <'  \xe2\x98\x91 PASS'>)})
            (C {<echo>})
          ]
        )
    )
    (command.ShFunction
      name: error_test
      body: 
        (command.BraceGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:FILE)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [2432]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:INPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$2')}
                  spids: [2436]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:OUTPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$3')}
                  spids: [2440]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:EXPECTED_OUTPUT)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$4')}
                  spids: [2444]
                )
              ]
            )
            (C {<info>} {(DQ <'Error Test: '> ($ Id.VSub_DollarName '$FILE'))})
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.AndOr
                          ops: [Id.Op_DPipe]
                          children: [
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.ml>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                            (C {<Id.Lit_LBracket '['>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                                      )
                                  )
                                )
                              } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} 
                              {
                                (DQ 
                                  (command_sub
                                    left_token: <Id.Left_DollarParen '$('>
                                    command_list: 
                                      (command.CommandList
                                        children: [
                                          (C {<basename>} {($ Id.VSub_DollarName '$FILE')} {<.mli>})
                                        ]
                                      )
                                  )
                                )
                              } {<Id.Lit_RBracket ']'>}
                            )
                          ]
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<warning>} 
                      {
                        (DQ 
                          <
'  \xe2\x8a\x98 FAILED: .ml files should not need to be run against error tests. '
                          > <Id.Lit_Other '\\'> <n>
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [2457 2512]
                )
              ]
              else_action: [
                (C {<debug>} 
                  {
                    (DQ <"  '"> ($ Id.VSub_DollarName '$REFMT') <' -print-width 50 -print re '> 
                      ($ Id.VSub_DollarName '$INPUT') </> ($ Id.VSub_DollarName '$FILE') <' &> '> ($ Id.VSub_DollarName '$OUTPUT') </> 
                      ($ Id.VSub_DollarName '$FILE') <"'">
                    )
                  }
                )
                (C {<cd>} {($ Id.VSub_DollarName '$INPUT')})
                (command.Simple
                  words: [
                    {($ Id.VSub_DollarName '$REFMT')}
                    {<-print-width>}
                    {<50>}
                    {<-print>}
                    {<re>}
                    {
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        command_list: 
                          (command.CommandList
                            children: [(C {<basename>} {($ Id.VSub_DollarName '$FILE')})]
                          )
                      )
                    }
                  ]
                  redirects: [
                    (redir
                      op: <Id.Redir_AndGreat '&>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
                    )
                  ]
                )
                (command.Simple
                  words: [{<cd>} {<->}]
                  redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{</dev/null>})]
                )
              ]
            )
            (C {<debug>} 
              {
                (DQ <'  Comparing results:  diff '> ($ Id.VSub_DollarName '$OUTPUT') </> 
                  ($ Id.VSub_DollarName '$FILE') <' '> ($ Id.VSub_DollarName '$EXPECTED_OUTPUT') </> ($ Id.VSub_DollarName '$FILE')
                )
              }
            )
            (C {<diff>} {<--unchanged-line-format> <Id.Lit_Equals '='> (DQ )} 
              {<--new-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} {<--old-line-format> <Id.Lit_Equals '='> (DQ <':%dn: %L'>)} 
              {($ Id.VSub_DollarName '$OUTPUT') </> ($ Id.VSub_DollarName '$FILE')} {($ Id.VSub_DollarName '$EXPECTED_OUTPUT') </> ($ Id.VSub_DollarName '$FILE')}
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_eq
                                  left: {($ Id.VSub_QMark '$?')}
                                  right: {<0>}
                                )
                            )
                          ]
                          negated: T
                        )
                      terminator: <Id.Op_Semi _>
                    )
                  ]
                  action: [
                    (C {<warning>} {(DQ <'  \xe2\x8a\x98 FAILED'> <Id.Lit_Other '\\'> <n>)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) ($ Id.VSub_DollarName '$OUTPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (C {<info>} {(DQ <"  doesn't match expected output">)})
                    (C {<info>} 
                      {
                        (DQ <'  '> (${ Id.VSub_Name INFO) ($ Id.VSub_DollarName '$EXPECTED_OUTPUT') </> 
                          ($ Id.VSub_DollarName '$FILE') (${ Id.VSub_Name RESET)
                        )
                      }
                    )
                    (C {<echo>} {(DQ )})
                    (command.ControlFlow
                      token: <Id.ControlFlow_Return return>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [2638 2653]
                )
              ]
            )
            (C {<success>} {(DQ <'  \xe2\x98\x91 PASS'>)})
            (C {<echo>})
          ]
        )
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<cd>} {($ Id.VSub_DollarName '$UNIT_TEST_INPUT')})
        (command.Pipeline
          children: [
            (C {<find>} {<.>} {<-type>} {<f>} {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\('>)} 
              {<-name>} {(DQ <'*.re*'>)} {<-or>} {<-name>} {(DQ <'*.ml*'>)} 
              {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\)'>)}
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(command.Sentence child:(C {<read>} {<file>}) terminator:<Id.Op_Semi _>)]
              body: 
                (command.DoGroup
                  children: [
                    (C {<unit_test>} {($ Id.VSub_DollarName '$file')} 
                      {($ Id.VSub_DollarName '$UNIT_TEST_INPUT')} {($ Id.VSub_DollarName '$UNIT_TEST_OUTPUT')} {($ Id.VSub_DollarName '$UNIT_TEST_EXPECTED_OUTPUT')}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ ($ Id.VSub_DollarName '$file') <' -- failed unit_test'>)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_DGreat '>>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {($ Id.VSub_DollarName '$FAILED_TESTS')}
                                )
                              ]
                            )
                          ]
                          spids: [2786 2801]
                        )
                      ]
                    )
                    (C {<idempotent_test>} {($ Id.VSub_DollarName '$file')} 
                      {($ Id.VSub_DollarName '$UNIT_TEST_INPUT')} {($ Id.VSub_DollarName '$UNIT_TEST_OUTPUT')} {($ Id.VSub_DollarName '$UNIT_TEST_EXPECTED_OUTPUT')}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ ($ Id.VSub_DollarName '$file') <' -- failed idempotent_test'>)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_DGreat '>>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {($ Id.VSub_DollarName '$FAILED_TESTS')}
                                )
                              ]
                            )
                          ]
                          spids: [2831 2846]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
          negated: F
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<cd>} {($ Id.VSub_DollarName '$TYPE_TEST_INPUT')})
        (command.Pipeline
          children: [
            (C {<find>} {<.>} {<-type>} {<f>} {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\('>)} 
              {<-name>} {(DQ <'*.re*'>)} {<-or>} {<-name>} {(DQ <'*.ml*'>)} 
              {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\)'>)}
            )
            (C {<sort>})
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(command.Sentence child:(C {<read>} {<file>}) terminator:<Id.Op_Semi _>)]
              body: 
                (command.DoGroup
                  children: [
                    (C {<typecheck_test>} {($ Id.VSub_DollarName '$file')} 
                      {($ Id.VSub_DollarName '$TYPE_TEST_INPUT')} {($ Id.VSub_DollarName '$TYPE_TEST_OUTPUT')}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ ($ Id.VSub_DollarName '$file') <' -- failed typecheck_test'>)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_DGreat '>>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {($ Id.VSub_DollarName '$FAILED_TESTS')}
                                )
                              ]
                            )
                          ]
                          spids: [2923 2938]
                        )
                      ]
                    )
                    (C {<unit_test>} {($ Id.VSub_DollarName '$file')} 
                      {($ Id.VSub_DollarName '$TYPE_TEST_INPUT')} {($ Id.VSub_DollarName '$TYPE_TEST_OUTPUT')} {($ Id.VSub_DollarName '$TYPE_TEST_EXPECTED_OUTPUT')}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ ($ Id.VSub_DollarName '$file') <' -- failed unit_test'>)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_DGreat '>>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {($ Id.VSub_DollarName '$FAILED_TESTS')}
                                )
                              ]
                            )
                          ]
                          spids: [2967 2982]
                        )
                      ]
                    )
                    (C {<idempotent_test>} {($ Id.VSub_DollarName '$file')} 
                      {($ Id.VSub_DollarName '$TYPE_TEST_INPUT')} {($ Id.VSub_DollarName '$TYPE_TEST_OUTPUT')} {($ Id.VSub_DollarName '$TYPE_TEST_EXPECTED_OUTPUT')}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ ($ Id.VSub_DollarName '$file') <' -- failed idempotent_test'>)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_DGreat '>>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {($ Id.VSub_DollarName '$FAILED_TESTS')}
                                )
                              ]
                            )
                          ]
                          spids: [3011 3026]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
          negated: F
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (C {<cd>} {($ Id.VSub_DollarName '$ERROR_TEST_INPUT')})
        (command.Pipeline
          children: [
            (C {<find>} {<.>} {<-type>} {<f>} {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\('>)} 
              {<-name>} {(DQ <'*.re*'>)} {<-or>} {<-name>} {(DQ <'*.ml*'>)} 
              {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\)'>)}
            )
            (command.WhileUntil
              keyword: <Id.KW_While while>
              cond: [(command.Sentence child:(C {<read>} {<file>}) terminator:<Id.Op_Semi _>)]
              body: 
                (command.DoGroup
                  children: [
                    (C {<error_test>} {($ Id.VSub_DollarName '$file')} 
                      {($ Id.VSub_DollarName '$ERROR_TEST_INPUT')} {($ Id.VSub_DollarName '$ERROR_TEST_OUTPUT')} {($ Id.VSub_DollarName '$ERROR_TEST_EXPECTED_OUTPUT')}
                    )
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (command.Pipeline
                                  children: [
                                    (command.DBracket
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_eq
                                          left: {($ Id.VSub_QMark '$?')}
                                          right: {<0>}
                                        )
                                    )
                                  ]
                                  negated: T
                                )
                              terminator: <Id.Op_Semi _>
                            )
                          ]
                          action: [
                            (command.Simple
                              words: [
                                {<echo>}
                                {(DQ ($ Id.VSub_DollarName '$file') <' -- failed error_test'>)}
                              ]
                              redirects: [
                                (redir
                                  op: <Id.Redir_DGreat '>>'>
                                  loc: (redir_loc.Fd fd:1)
                                  arg: {($ Id.VSub_DollarName '$FAILED_TESTS')}
                                )
                              ]
                            )
                          ]
                          spids: [3101 3116]
                        )
                      ]
                    )
                  ]
                )
            )
          ]
          negated: F
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_s
                      child: {($ Id.VSub_DollarName '$FAILED_TESTS')}
                    )
                )
              terminator: <Id.Op_Semi _>
            )
          ]
          action: [
            (C {<warning>} {(DQ <'Failed tests:'>)})
            (C {<cat>} {($ Id.VSub_DollarName '$FAILED_TESTS')})
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [3136 3147]
        )
      ]
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)