(command.CommandList children: [ (command.FuncDef name: get body: (command.BraceGroup children:[(C {(route)} {(DQ (GET))} {($ VSub_At '$@')})]) ) (command.FuncDef name: post body: (command.BraceGroup children:[(C {(route)} {(DQ (POST))} {($ VSub_At '$@')})]) ) (command.FuncDef name: delete body: (command.BraceGroup children:[(C {(route)} {(DQ (DELETE))} {($ VSub_At '$@')})]) ) (command.FuncDef name: status body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:martin_response_status) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) ] ) ) (command.FuncDef name: header body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:martin_response_headers) op: Equal rhs: { (DQ ($ VSub_DollarName '$martin_response_headers') ($ VSub_Number '$1') (': ') ($ VSub_Number '$2') ($ VSub_DollarName '$LF') ) } ) ] ) ] ) ) (command.FuncDef name: not_found body: (command.BraceGroup children: [ (C {(status)} {(DQ (404))}) (C {(header)} {(DQ (Content-type))} {(DQ (text/plain))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-gt)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(echo)} {(DQ ($ VSub_At '$@'))})] ) ] else_action: [(C {(echo)} {(DQ ('Not Found: ') ($ VSub_DollarName '$PATH_INFO'))})] ) ] ) ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:LF) op: Equal rhs: { (word_part.SingleQuotedPart left: <Left_DollarSingleQuote "$'"> tokens: [<Char_OneChar '\\n'>] ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:martin_routes) op:Equal rhs:{(DQ )})] ) (command.FuncDef name: route body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:martin_routes) op: Equal rhs: { (DQ ($ VSub_DollarName '$martin_routes') ($ VSub_Number '$1') (',') ($ VSub_Number '$2') (',') ($ VSub_Number '$3') ($ VSub_DollarName '$LF') ) } ) ] ) ] ) ) (command.FuncDef name: martin_find_route body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$martin_routes'))}) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (command.SimpleCommand words: [{(read)} {(-r)} {(method)} {(path)} {(action)}] more_env: [(env_pair name:IFS val:{(DQ (','))})] ) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ ($ VSub_DollarName '$method'))} {(Lit_Other ']')} ) (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$2'))} {(Lit_Other '=')} {(DQ ($ VSub_DollarName '$path'))} {(Lit_Other ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {($ VSub_DollarName '$action')}) (command.ControlFlow token: <ControlFlow_Return return> ) ] ) ] ) ] ) ) ] negated: F ) ] ) ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:martin_response_headers) op:Equal rhs:{(DQ )})] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:martin_response_status) op:Equal rhs:{(DQ )})] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:martin_response_file) op: Equal rhs: {(DQ ($ VSub_DollarName '$TMPDIR') (/martin_response) ($ VSub_Dollar '$$'))} ) ] ) (command.FuncDef name: martin_reset_response body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:martin_response_status) op: Equal rhs: {(DQ ('200 OK'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:martin_response_headers) op:Equal rhs:{(DQ )})] ) ] ) ) (command.FuncDef name: martin_dispatch body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:action) op: Equal rhs: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(martin_find_route)} {(DQ ($ VSub_DollarName '$REQUEST_METHOD'))} {(DQ ($ VSub_DollarName '$PATH_INFO'))} ) ] ) left_token: <Left_DollarParen '$('> ) ) } ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(KW_Bang '!')} {(DQ ($ VSub_DollarName '$action'))} {(Lit_Other ']')} ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:action) op: Equal rhs: {(DQ (not_found))} ) ] ) ] ) (C {(martin_reset_response)}) (command.SimpleCommand words: [{(DQ ($ VSub_DollarName '$action'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ ($ VSub_DollarName '$martin_response_file'))} ) ] ) (C {(header)} {(DQ (Status))} {(DQ ($ VSub_DollarName '$martin_response_status'))}) (C {(header)} {(DQ (Content-Length))} { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(wc)} {(-c)} {(DQ ($ VSub_DollarName '$martin_response_file'))}) (C {(awk)} {(SQ <'{ print $1 }'>)}) ] negated: F ) ] ) left_token: <Left_DollarParen '$('> ) ) } ) (C {(echo)} {(DQ ($ VSub_DollarName '$martin_response_headers'))}) (C {(cat)} {(DQ ($ VSub_DollarName '$martin_response_file'))}) ] ) ) (command.FuncDef name: martin body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_Other '[')} {($ VSub_DollarName '$REQUEST_METHOD')} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(martin_dispatch)})] ) ] else_action: [ (C {(.)} {(./wwwoosh.sh)}) (C {(wwwoosh)} {(martin_dispatch)} {($ VSub_DollarName '$PORT')}) ] ) ] ) ) ] )