(CommandList children: [ (FuncDef name: 'balls::define_route' body: (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:verb) op: Equal rhs: {($ VSub_Number '$1')} spids: [16] ) ] spids: [14] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (Sentence child: (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: {($ VSub_Number '$1')} spids: [25] ) ] spids: [23] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (Sentence child: (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:action) op: Equal rhs: {($ VSub_Number '$1')} spids: [34] ) ] spids: [32] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:route_line) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(echo)} {(-e)} { (DQ ($ VSub_Name '$verb') (Lit_Other '\\') (t) ($ VSub_Name '$path') (Lit_Other '\\') (t) ($ VSub_Name '$action') ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [46 60] ) ) } spids: [44] ) ] spids: [42] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$ROUTES'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ROUTES) op: Equal rhs: {(DQ ($ VSub_Name '$route_line'))} spids: [80] ) ] spids: [80] ) ] spids: [16777215 77] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ROUTES) op: Equal rhs: {(DQ ($ VSub_Name '$ROUTES') ('\n') ($ VSub_Name '$route_line'))} spids: [89] ) ] spids: [89] ) ] spids: [86 97] ) ] spids: [11] ) spids: [4 10] ) (FuncDef name: 'b:GET' body: (BraceGroup children: [ (Sentence child: (C {(balls) (Lit_Other ':') (Lit_Other ':') (define_route)} {(GET)} {(DQ ($ VSub_At '$@'))} ) terminator: <Op_Semi ';'> ) ] spids: [108] ) spids: [102 107] ) (FuncDef name: 'b:POST' body: (BraceGroup children: [ (Sentence child: (C {(balls) (Lit_Other ':') (Lit_Other ':') (define_route)} {(POST)} {(DQ ($ VSub_At '$@'))} ) terminator: <Op_Semi ';'> ) ] spids: [130] ) spids: [124 129] ) (FuncDef name: 'b:PUT' body: (BraceGroup children: [ (Sentence child: (C {(balls) (Lit_Other ':') (Lit_Other ':') (define_route)} {(PUT)} {(DQ ($ VSub_At '$@'))} ) terminator: <Op_Semi ';'> ) ] spids: [152] ) spids: [146 151] ) (FuncDef name: 'b:DELETE' body: (BraceGroup children: [ (Sentence child: (C {(balls) (Lit_Other ':') (Lit_Other ':') (define_route)} {(DELETE)} {(DQ ($ VSub_At '$@'))} ) terminator: <Op_Semi ';'> ) ] spids: [174] ) spids: [168 173] ) (FuncDef name: 'balls::route' body: (BraceGroup children: [ (AndOr ops: [Op_DAmp] children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Name '$BALLS_RELOAD'))} right: {(1)} ) ) (C {(balls) (Lit_Other ':') (Lit_Other ':') (load_app)}) ] ) (AndOr ops: [Op_DAmp] children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Name '$REQUEST_METHOD'))} right: {(DQ (HEAD))} ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:body_sock) op: Equal rhs: {(/dev/null)} spids: [237] ) ] spids: [237] ) ] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:action) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$ROUTES'))}) (C {(grep)} {(DQ ('^') ($ VSub_Name '$REQUEST_METHOD'))}) (BraceGroup children: [ (WhileUntil keyword: <KW_While while> cond: [ (Sentence child: (C {(read)} {(line)}) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:arr) op: Equal rhs: { (ArrayLiteralPart words: [{($ VSub_Name '$line')}] ) } spids: [278] ) ] spids: [278] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:path) op: Equal rhs: { (BracedVarSub token: <VSub_Name arr> bracket_op: (ArrayIndex expr: (ArithWord w:{(Lit_Digits 1)}) ) spids: [285 290] ) } spids: [284] ) ] spids: [284] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:act) op: Equal rhs: { (BracedVarSub token: <VSub_Name arr> bracket_op: (ArrayIndex expr: (ArithWord w:{(Lit_Digits 2)}) ) spids: [294 299] ) } spids: [293] ) ] spids: [293] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: { (DQ ($ VSub_Name '$REQUEST_PATH')) } right: {(DQ ($ VSub_Name '$path'))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {($ VSub_Name '$act')}) (ControlFlow token: <ControlFlow_Break break> ) ] spids: [16777215 319] ) ] spids: [16777215 330] ) ] spids: [275 333] ) ) ] spids: [265] ) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [245 339] ) } spids: [244] ) ] spids: [242] ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_Name '$action'))} {(Lit_Other ']')}) (C {(exists)} {(DQ ($ VSub_Name '$action'))}) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:headers_sock) op: Equal rhs: {($ VSub_Name '$BALLS_TMP') (/balls.headers.) (CommandSubPart command_list: (CommandList children:[(C {(_hash)})]) left_token: <Left_CommandSub '$('> spids: [370 372] ) (.sock) } spids: [367] ) ] spids: [367] ) (AndOr ops: [Op_DPipe] children: [ (C {(Lit_Other '[')} {(-p)} {($ VSub_Name '$headers_sock')} {(Lit_Other ']')}) (C {(mkfifo)} {($ VSub_Name '$headers_sock')}) ] ) (Pipeline children: [ (Subshell child: (SimpleCommand words: [{($ VSub_Name '$action')}] redirects: [ (Redir op: <Redir_Great '3>'> fd: 3 arg_word: {($ VSub_Name '$headers_sock')} ) ] ) spids: [392 399] ) (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:headers) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {($ VSub_Name '$headers_sock')} ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [407 412] ) } spids: [406] ) ] spids: [406] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:body) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(cat)} {(-)})]) left_token: <Left_CommandSub '$('> spids: [416 420] ) } spids: [415] ) ] spids: [415] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:response) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(echo)} {(DQ ($ VSub_Name '$headers'))}) (C {(echo)} { (DQ ('Content-Length: ') (BracedVarSub token: <VSub_Name body> prefix_op: VSub_Pound spids: [439 442] ) ) } ) (C {(echo)}) (C {(echo)} {(DQ ($ VSub_Name '$body'))}) ] ) left_token: <Left_CommandSub '$('> spids: [425 456] ) } spids: [424] ) ] spids: [424] ) (C {(echo)} {(DQ ($ VSub_Name '$response'))}) ] spids: [403] ) ] negated: F ) (C {(rm)} {(-f)} {(DQ ($ VSub_Name '$headers_sock'))}) ] spids: [16777215 364] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Name '$REQUEST_METHOD'))} right: {(DQ (HEAD))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:REQUEST_METHOD) op: Equal rhs: {(GET)} spids: [502] ) ] spids: [502] ) (C {(balls) (Lit_Other ':') (Lit_Other ':') (route)}) ] spids: [16777215 499] ) ] else_action: [ (SimpleCommand words: [{(http) (Lit_Other ':') (Lit_Other ':') (status)} {(404)}] redirects: [(Redir op:<Redir_GreatAnd '3>&'> fd:3 arg_word:{(1)})] ) (SimpleCommand words: [{(http) (Lit_Other ':') (Lit_Other ':') (content_type)} {(text/plain)}] redirects: [(Redir op:<Redir_GreatAnd '3>&'> fd:3 arg_word:{(1)})] ) (C {(echo)}) ] spids: [512 540] ) (C {(echo)} { (DQ ('No route matched ') ($ VSub_Name '$REQUEST_METHOD') (' ') ($ VSub_Name '$REQUEST_PATH') ) } ) (C {(echo)}) ] spids: [479 557] ) ] spids: [198] ) spids: [191 197] ) ] )