(CommandList children: [ (AndOr children: [ (SimpleCommand words: [{(gawk)} {(--version)}] redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[109])] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--version))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(AndOr children:[(C {(printf)} {(SQ <'0.23\\n'>)}) (C {(exit)})] op_id:Op_DAmp)] spids: [16777215 136] ) ] spids: [16777215 149] ) (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [ {(printf)} {(SQ <'%s\\n'>)} { (SQ <'This utility converts ANSI codes in data passed to stdin\n'> <'It has 4 optional parameters:\n'> <'--bg=dark --palette=linux|solarized|tango|xterm --css-only|--body-only\n'> <'E.g.: ls -l --color=always | ansi2html.sh --bg=dark > ls.html'> ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[172])] ) (C {(exit)}) ] spids: [156] ) spids: [152 155] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--help))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)})] spids: [16777215 198] ) ] spids: [16777215 203] ) (FuncDef name: processArg body: (BraceGroup children: [ (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ ('--bg=dark'))} {(Lit_Other ']')} ) (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dark_bg) op: Equal rhs: {(yes)} spids: [231] ) ] spids: [231] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [229] ) ] op_id: Op_DAmp ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--css-only))} {(Lit_Other ']')} ) (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:css_only) op: Equal rhs: {(yes)} spids: [259] ) ] spids: [259] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [257] ) ] op_id: Op_DAmp ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--body-only))} {(Lit_Other ']')} ) (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:body_only) op: Equal rhs: {(yes)} spids: [287] ) ] spids: [287] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [285] ) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ ('--palette=solarized'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P0) op: Equal rhs: {(073642)} spids: [321] ) ] spids: [321] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P1) op: Equal rhs: {(D30102)} spids: [325] ) ] spids: [325] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P2) op: Equal rhs: {(859900)} spids: [329] ) ] spids: [329] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P3) op: Equal rhs: {(B58900)} spids: [333] ) ] spids: [333] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P4) op: Equal rhs: {(268BD2)} spids: [338] ) ] spids: [338] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P5) op: Equal rhs: {(D33682)} spids: [342] ) ] spids: [342] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P6) op: Equal rhs: {(2AA198)} spids: [346] ) ] spids: [346] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P7) op: Equal rhs: {(EEE8D5)} spids: [350] ) ] spids: [350] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P8) op: Equal rhs: {(002B36)} spids: [355] ) ] spids: [355] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P9) op: Equal rhs: {(CB4B16)} spids: [359] ) ] spids: [359] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P10) op: Equal rhs: {(586E75)} spids: [363] ) ] spids: [363] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P11) op: Equal rhs: {(657B83)} spids: [367] ) ] spids: [367] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P12) op: Equal rhs: {(839496)} spids: [372] ) ] spids: [372] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P13) op: Equal rhs: {(6C71C4)} spids: [376] ) ] spids: [376] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P14) op: Equal rhs: {(93A1A1)} spids: [380] ) ] spids: [380] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P15) op: Equal rhs: {(FDF6E3)} spids: [384] ) ] spids: [384] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [16777215 314] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ ('--palette=solarized-xterm'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P0) op: Equal rhs: {(262626)} spids: [417] ) ] spids: [417] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P1) op: Equal rhs: {(AF0000)} spids: [421] ) ] spids: [421] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P2) op: Equal rhs: {(5F8700)} spids: [425] ) ] spids: [425] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P3) op: Equal rhs: {(AF8700)} spids: [429] ) ] spids: [429] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P4) op: Equal rhs: {(0087FF)} spids: [434] ) ] spids: [434] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P5) op: Equal rhs: {(AF005F)} spids: [438] ) ] spids: [438] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P6) op: Equal rhs: {(00AFAF)} spids: [442] ) ] spids: [442] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P7) op: Equal rhs: {(E4E4E4)} spids: [446] ) ] spids: [446] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P8) op: Equal rhs: {(1C1C1C)} spids: [451] ) ] spids: [451] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P9) op: Equal rhs: {(D75F00)} spids: [455] ) ] spids: [455] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P10) op: Equal rhs: {(585858)} spids: [459] ) ] spids: [459] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P11) op: Equal rhs: {(626262)} spids: [463] ) ] spids: [463] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P12) op: Equal rhs: {(808080)} spids: [468] ) ] spids: [468] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P13) op: Equal rhs: {(5F5FAF)} spids: [472] ) ] spids: [472] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P14) op: Equal rhs: {(8A8A8A)} spids: [476] ) ] spids: [476] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P15) op: Equal rhs: {(FFFFD7)} spids: [480] ) ] spids: [480] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [393 410] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ ('--palette=tango'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P0) op: Equal rhs: {(000000)} spids: [513] ) ] spids: [513] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P1) op: Equal rhs: {(CC0000)} spids: [517] ) ] spids: [517] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P2) op: Equal rhs: {(4E9A06)} spids: [521] ) ] spids: [521] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P3) op: Equal rhs: {(C4A000)} spids: [525] ) ] spids: [525] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P4) op: Equal rhs: {(3465A4)} spids: [530] ) ] spids: [530] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P5) op: Equal rhs: {(75507B)} spids: [534] ) ] spids: [534] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P6) op: Equal rhs: {(06989A)} spids: [538] ) ] spids: [538] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P7) op: Equal rhs: {(D3D7CF)} spids: [542] ) ] spids: [542] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P8) op: Equal rhs: {(555753)} spids: [547] ) ] spids: [547] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P9) op: Equal rhs: {(EF2929)} spids: [551] ) ] spids: [551] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P10) op: Equal rhs: {(8AE234)} spids: [555] ) ] spids: [555] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P11) op: Equal rhs: {(FCE94F)} spids: [559] ) ] spids: [559] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P12) op: Equal rhs: {(729FCF)} spids: [564] ) ] spids: [564] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P13) op: Equal rhs: {(AD7FA8)} spids: [568] ) ] spids: [568] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P14) op: Equal rhs: {(34E2E2)} spids: [572] ) ] spids: [572] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P15) op: Equal rhs: {(EEEEEC)} spids: [576] ) ] spids: [576] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [489 506] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ ('--palette=xterm'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P0) op: Equal rhs: {(000000)} spids: [605] ) ] spids: [605] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P1) op: Equal rhs: {(CD0000)} spids: [609] ) ] spids: [609] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P2) op: Equal rhs: {(00CD00)} spids: [613] ) ] spids: [613] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P3) op: Equal rhs: {(CDCD00)} spids: [617] ) ] spids: [617] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P4) op: Equal rhs: {(0000EE)} spids: [622] ) ] spids: [622] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P5) op: Equal rhs: {(CD00CD)} spids: [626] ) ] spids: [626] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P6) op: Equal rhs: {(00CDCD)} spids: [630] ) ] spids: [630] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P7) op: Equal rhs: {(E5E5E5)} spids: [634] ) ] spids: [634] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P8) op: Equal rhs: {(7F7F7F)} spids: [639] ) ] spids: [639] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P9) op: Equal rhs: {(FF0000)} spids: [643] ) ] spids: [643] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P10) op: Equal rhs: {(00FF00)} spids: [647] ) ] spids: [647] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P11) op: Equal rhs: {(FFFF00)} spids: [651] ) ] spids: [651] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P12) op: Equal rhs: {(5C5CFF)} spids: [656] ) ] spids: [656] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P13) op: Equal rhs: {(FF00FF)} spids: [660] ) ] spids: [660] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P14) op: Equal rhs: {(00FFFF)} spids: [664] ) ] spids: [664] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P15) op: Equal rhs: {(FFFFFF)} spids: [668] ) ] spids: [668] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] spids: [585 602] ) ] else_action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P0) op:Equal rhs:{(000000)} spids:[683])] spids: [683] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P1) op:Equal rhs:{(AA0000)} spids:[687])] spids: [687] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P2) op:Equal rhs:{(00AA00)} spids:[691])] spids: [691] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P3) op:Equal rhs:{(AA5500)} spids:[695])] spids: [695] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P4) op:Equal rhs:{(0000AA)} spids:[700])] spids: [700] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P5) op:Equal rhs:{(AA00AA)} spids:[704])] spids: [704] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P6) op:Equal rhs:{(00AAAA)} spids:[708])] spids: [708] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P7) op:Equal rhs:{(AAAAAA)} spids:[712])] spids: [712] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P8) op:Equal rhs:{(555555)} spids:[717])] spids: [717] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:P9) op:Equal rhs:{(FF5555)} spids:[721])] spids: [721] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P10) op: Equal rhs: {(55FF55)} spids: [725] ) ] spids: [725] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P11) op: Equal rhs: {(FFFF55)} spids: [729] ) ] spids: [729] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P12) op: Equal rhs: {(5555FF)} spids: [734] ) ] spids: [734] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P13) op: Equal rhs: {(FF55FF)} spids: [738] ) ] spids: [738] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P14) op: Equal rhs: {(55FFFF)} spids: [742] ) ] spids: [742] ) terminator: <Op_Semi ';'> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:P15) op: Equal rhs: {(FFFFFF)} spids: [746] ) ] spids: [746] ) terminator: <Op_Semi ';'> ) (Sentence child: (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ ('--palette=linux'))} {(Lit_Other ']')} ) (ControlFlow token:<ControlFlow_Return return>) ] op_id: Op_DAmp ) terminator: <Op_Semi ';'> ) ] spids: [677 771] ) ] spids: [210] ) spids: [206 209] ) (C {(processArg)}) (ForEach iter_name: var iter_words: [{(DQ ($ VSub_At '$@'))}] do_arg_iter: False body: (DoGroup children: [ (Sentence child: (C {(processArg)} {($ VSub_Name '$var')}) terminator: <Op_Semi ';'> ) ] spids: [792 799] ) spids: [786 790] ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$css_only'))} {(Lit_Other ']')}) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(usage)}) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(sed)} {(--version)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [838] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [841] ) ] ) ] negated: True ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(gsed)} {(--version)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [854] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [857] ) ] ) terminator: <Op_Semi ';'> ) ] action: [(C {(alias)} {(Lit_VarLike 'sed=') (gsed)})] spids: [16777215 861] ) ] else_action: [ (SimpleCommand words: [{(echo)} {(DQ ("Error, can't find an acceptable GNU sed."))}] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[879])] ) (C {(exit)} {(1)}) ] spids: [870 888] ) ] spids: [16777215 845] ) ] spids: [16777215 890] ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$css_only'))} {(Lit_Other ']')}) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} {(SQ <'%s'>)} { (DQ ('<html>\n') ('<head>\n') ('<meta http-equiv=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (Content-Type) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' content=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('text/html; charset=utf-8') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('/>\n') ('<style type=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (text/css) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>\n') ) } ) ] op_id: Op_DPipe ) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} { (DQ ('.ef0,.f0 { color: #') ($ VSub_Name '$P0') ('; } .eb0,.b0 { background-color: #') ($ VSub_Name '$P0') ('; }\n') ('.ef1,.f1 { color: #') ($ VSub_Name '$P1') ('; } .eb1,.b1 { background-color: #') ($ VSub_Name '$P1') ('; }\n') ('.ef2,.f2 { color: #') ($ VSub_Name '$P2') ('; } .eb2,.b2 { background-color: #') ($ VSub_Name '$P2') ('; }\n') ('.ef3,.f3 { color: #') ($ VSub_Name '$P3') ('; } .eb3,.b3 { background-color: #') ($ VSub_Name '$P3') ('; }\n') ('.ef4,.f4 { color: #') ($ VSub_Name '$P4') ('; } .eb4,.b4 { background-color: #') ($ VSub_Name '$P4') ('; }\n') ('.ef5,.f5 { color: #') ($ VSub_Name '$P5') ('; } .eb5,.b5 { background-color: #') ($ VSub_Name '$P5') ('; }\n') ('.ef6,.f6 { color: #') ($ VSub_Name '$P6') ('; } .eb6,.b6 { background-color: #') ($ VSub_Name '$P6') ('; }\n') ('.ef7,.f7 { color: #') ($ VSub_Name '$P7') ('; } .eb7,.b7 { background-color: #') ($ VSub_Name '$P7') ('; }\n') ('.ef8, .f0 > .bold,.bold > .f0 { color: #') ($ VSub_Name '$P8') ('; font-weight: normal; }\n') ('.ef9, .f1 > .bold,.bold > .f1 { color: #') ($ VSub_Name '$P9') ('; font-weight: normal; }\n') ('.ef10,.f2 > .bold,.bold > .f2 { color: #') ($ VSub_Name '$P10') ('; font-weight: normal; }\n') ('.ef11,.f3 > .bold,.bold > .f3 { color: #') ($ VSub_Name '$P11') ('; font-weight: normal; }\n') ('.ef12,.f4 > .bold,.bold > .f4 { color: #') ($ VSub_Name '$P12') ('; font-weight: normal; }\n') ('.ef13,.f5 > .bold,.bold > .f5 { color: #') ($ VSub_Name '$P13') ('; font-weight: normal; }\n') ('.ef14,.f6 > .bold,.bold > .f6 { color: #') ($ VSub_Name '$P14') ('; font-weight: normal; }\n') ('.ef15,.f7 > .bold,.bold > .f7 { color: #') ($ VSub_Name '$P15') ('; font-weight: normal; }\n') ('.eb8 { background-color: #') ($ VSub_Name '$P8') ('; }\n') ('.eb9 { background-color: #') ($ VSub_Name '$P9') ('; }\n') ('.eb10 { background-color: #') ($ VSub_Name '$P10') ('; }\n') ('.eb11 { background-color: #') ($ VSub_Name '$P11') ('; }\n') ('.eb12 { background-color: #') ($ VSub_Name '$P12') ('; }\n') ('.eb13 { background-color: #') ($ VSub_Name '$P13') ('; }\n') ('.eb14 { background-color: #') ($ VSub_Name '$P14') ('; }\n') ('.eb15 { background-color: #') ($ VSub_Name '$P15') ('; }\n') ) } ) ] op_id: Op_DPipe ) (ForEach iter_name: red iter_words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)}] do_arg_iter: False body: (DoGroup children: [ (ForEach iter_name: green iter_words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)}] do_arg_iter: False body: (DoGroup children: [ (ForEach iter_name: blue iter_words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)}] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:c) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(Lit_Digits 16)}) right: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$red')}) right: (ArithWord w:{(Lit_Digits 36)}) ) ) right: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$green')}) right: (ArithWord w:{(Lit_Digits 6)}) ) ) right: (ArithWord w:{($ VSub_Name '$blue')}) ) spids: [1114 1141] ) } spids: [1113] ) ] spids: [1113] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:r) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$red')}) right: (ArithWord w:{(Lit_Digits 40)}) ) right: (ArithWord w:{(Lit_Digits 55)}) ) right: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Name '$red')}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) spids: [1145 1168] ) } spids: [1144] ) ] spids: [1144] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:g) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$green')}) right: (ArithWord w:{(Lit_Digits 40)}) ) right: (ArithWord w:{(Lit_Digits 55)}) ) right: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Name '$green')}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) spids: [1172 1195] ) } spids: [1171] ) ] spids: [1171] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:b) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$blue')}) right: (ArithWord w:{(Lit_Digits 40)}) ) right: (ArithWord w:{(Lit_Digits 55)}) ) right: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Name '$blue')}) right: (ArithWord w:{(Lit_Digits 0)}) ) ) spids: [1199 1222] ) } spids: [1198] ) ] spids: [1198] ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} {(DQ ('.ef%d { color: #%2.2x%2.2x%2.2x; } '))} {($ VSub_Name '$c')} {($ VSub_Name '$r')} {($ VSub_Name '$g')} {($ VSub_Name '$b')} ) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} { (DQ ('.eb%d { background-color: #%2.2x%2.2x%2.2x; }') (Lit_Other '\\') (n) ) } {($ VSub_Name '$c')} {($ VSub_Name '$r')} {($ VSub_Name '$g')} {($ VSub_Name '$b')} ) ] op_id: Op_DPipe ) ] spids: [1110 1277] ) spids: [1095 1108] ) ] spids: [1087 1280] ) spids: [1072 1085] ) ] spids: [1064 1282] ) spids: [1049 1062] ) (ForEach iter_name: gray iter_words: [ { (CommandSubPart command_list: (CommandList children:[(C {(seq)} {(0)} {(23)})]) left_token: <Left_CommandSub '$('> spids: [1290 1296] ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:c) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$gray')}) right: (ArithWord w:{(Lit_Digits 232)}) ) spids: [1303 1308] ) } spids: [1302] ) ] spids: [1302] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:l) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$gray')}) right: (ArithWord w:{(Lit_Digits 10)}) ) right: (ArithWord w:{(Lit_Digits 8)}) ) spids: [1312 1321] ) } spids: [1311] ) ] spids: [1311] ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} {(DQ ('.ef%d { color: #%2.2x%2.2x%2.2x; } '))} {($ VSub_Name '$c')} {($ VSub_Name '$l')} {($ VSub_Name '$l')} {($ VSub_Name '$l')} ) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} {(DQ ('.eb%d { background-color: #%2.2x%2.2x%2.2x; }') (Lit_Other '\\') (n))} {($ VSub_Name '$c')} {($ VSub_Name '$l')} {($ VSub_Name '$l')} {($ VSub_Name '$l')} ) ] op_id: Op_DPipe ) ] spids: [1299 1375] ) spids: [1289 1297] ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} {(SQ <'%s'>)} {(SQ <'\n'> <'.f9 { color: '>) (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$dark_bg'))} {(Lit_Other ']')}) (AndOr children: [ (C {(printf)} {(DQ ('#') ($ VSub_Name '$P7') (';'))}) (C {(printf)} {(DQ ('#') ($ VSub_Name '$P0') (';'))}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] ) left_token: <Left_Backtick '`'> spids: [1398 1426] ) (SQ <' }\n'> <'.b9 { background-color: #'>) (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$dark_bg'))} {(Lit_Other ']')}) (AndOr children: [ (C {(printf)} {($ VSub_Name '$P0')}) (C {(printf)} {($ VSub_Name '$P15')}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] ) left_token: <Left_Backtick '`'> spids: [1431 1451] ) (SQ <'; }\n'> <'.f9 > .bold,.bold > .f9, body.f9 > pre > .bold {\n'> <' /* Bold is heavy black on white, or bright white\n'> <' depending on the default background */\n'> <' color: '> ) (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$dark_bg'))} {(Lit_Other ']')}) (AndOr children: [ (C {(printf)} {(DQ ('#') ($ VSub_Name '$P15') (';'))}) (C {(printf)} {(DQ ('#') ($ VSub_Name '$P0') (';'))}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] ) left_token: <Left_Backtick '`'> spids: [1459 1487] ) (SQ <'\n'> <' font-weight: '>) (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$dark_bg'))} {(Lit_Other ']')}) (AndOr children: [(C {(printf)} {(SQ <'normal;'>)}) (C {(printf)} {(SQ <'bold;'>)})] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] ) left_token: <Left_Backtick '`'> spids: [1492 1516] ) (SQ <'\n'> <'}\n'> <'.reverse {\n'> <' /* CSS does not support swapping fg and bg colours unfortunately,\n'> <' so just hardcode something that will look OK on all backgrounds. */\n'> <' '> ) (DQ ('color: #') ($ VSub_Name '$P0') ('; background-color: #') ($ VSub_Name '$P7') (';')) (SQ <'\n'> <'}\n'> <'.underline { text-decoration: underline; }\n'> <'.line-through { text-decoration: line-through; }\n'> <'.blink { text-decoration: blink; }\n'> <'\n'> <'/* Avoid pixels between adjacent span elements.\n'> <' Note this only works for lines less than 80 chars\n'> <' where we close span elements on the same line.\n'> <'span { display: inline-block; }\n'> <'*/\n'> ) } ) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$css_only'))} {(Lit_Other ']')}) (SimpleCommand words: [ {(printf)} {(SQ <'%s\\n'>)} {(SQ <'To use the css generated from --css-only, do: '>) (SQ <'<head><link rel="stylesheet" type="text/css" href="style.css"></head>'>) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[1581])] ) ] op_id: Op_DAmp ) ] op_id: Op_DPipe ) (AndOr children: [(C {(Lit_Other '[')} {(DQ ($ VSub_Name '$css_only'))} {(Lit_Other ']')}) (C {(exit)})] op_id: Op_DAmp ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} {(SQ <'%s'>)} {(SQ <'</style>\n'> <'</head>\n'> <'\n'> <'<body class="f9 b9">\n'> <'<pre>\n'>)} ) ] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (SimpleCommand words: [{(printf)} {(SQ <'%s\\n'>)} {(SQ <'Be sure to use <body class="f9 b9"> and <pre>'>)}] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[1640])] ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:p) op:Equal rhs:{(SQ <'\\x1b\\['>)} spids:[1644])] spids: [1644] ) (Pipeline children: [ (C {(sed)} { (DQ ('\n') ('# escape ampersand and quote\n') ('s#&#') (Lit_Other '\\') ('&#g; s#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('#') (Lit_Other '\\') ('"#g;\n') ('s#') (Lit_Other '\\') ('x1b[^') (Lit_Other '\\') ('x1b]*') (Lit_Other '\\') (x1b) (EscapedLiteralPart token:<Lit_EscapedChar '\\\\'>) (Lit_Other '\\') ('##g # strip anything between ') (Lit_Other '\\') ('e and ST\n') ('s#') (Lit_Other '\\') ('x1b][0-9]*;[^') (Lit_Other '\\') ('a]*') (Lit_Other '\\') ('a##g # strip any OSC (xterm title etc.)\n') ('\n') ('s#') (Lit_Other '\\') (r) (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('## # strip trailing ') (Lit_Other '\\') ('r\n') ('\n') ('# strip other non SGR escape sequences\n') ('s#[') (Lit_Other '\\') ('x07]##g\n') ('s#') (Lit_Other '\\') ('x1b[]>=') (Lit_Other '\\') ('][0-9;]*##g\n') ('s#') (Lit_Other '\\') ('x1bP+.') (Lit_Other '\\') ('{5') (Lit_Other '\\') ('}##g\n') ('# Mark cursor positioning codes ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('Jr;c;\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,2') (Lit_Other '\\') ('}') (Lit_Other '\\') (')G#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('J;') (Lit_Other '\\') ('1;#g\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,2') (Lit_Other '\\') ('}') (Lit_Other '\\') (');') (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,2') (Lit_Other '\\') ('}') (Lit_Other '\\') (')H#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (J) (Lit_Other '\\') ('1;') (Lit_Other '\\') ('2;#g\n') ('\n') ('# Mark clear as ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('Cn where n=1 is screen and n=0 is to end-of-line\n') ('s#') (${ VSub_Name p) ('H#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('C1;#g\n') ('s#') (${ VSub_Name p) ('K#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('C0;#g\n') ('# Mark Cursor move columns as ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('Mn where n is +ve for right, -ve for left\n') ('s#') (${ VSub_Name p) ('C#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('M1;#g\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,') (Lit_Other '\\') ('}') (Lit_Other '\\') (')C#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (M) (Lit_Other '\\') ('1;#g\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,') (Lit_Other '\\') ('}') (Lit_Other '\\') (')D#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (M-) (Lit_Other '\\') ('1;#g\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,') (Lit_Other '\\') ('}') (Lit_Other '\\') (')P#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (X) (Lit_Other '\\') ('1;#g\n') ('\n') ('s#') (${ VSub_Name p) ('[0-9;?]*[^0-9;?m]##g\n') ('\n') ) } ) (C {(sed)} { (DQ ('\n') ('# escape HTML (ampersand and quote done above)\n') ('s#>#') (Lit_Other '\\') ('>#g; s#<#') (Lit_Other '\\') ('<#g;\n') ('\n') ('# normalize SGR codes a little\n') ('\n') ("# split 256 colors out and mark so that they're not\n") ("# recognised by the following 'split combined' line\n") (':e\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9;]') (Lit_Other '\\') ('{1,') (Lit_Other '\\') ('}') (Lit_Other '\\') (');') (Lit_Other '\\') ('([34]8;5;[0-9]') (Lit_Other '\\') ('{1,3') (Lit_Other '\\') ('}') (Lit_Other '\\') (')m#') (${ VSub_Name p) (Lit_Other '\\') (1m) (${ VSub_Name p) ('\xc2\xac') (Lit_Other '\\') ('2m#g; t e\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([34]8;5;[0-9]') (Lit_Other '\\') ('{1,3') (Lit_Other '\\') ('}') (Lit_Other '\\') (')m#') (${ VSub_Name p) ('\xc2\xac') (Lit_Other '\\') ('1m#g;\n') ('\n') (':c\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,') (Lit_Other '\\') ('}') (Lit_Other '\\') (');') (Lit_Other '\\') ('([0-9;]') (Lit_Other '\\') ('{1,') (Lit_Other '\\') ('}') (Lit_Other '\\') (')m#') (${ VSub_Name p) (Lit_Other '\\') (1m) (${ VSub_Name p) (Lit_Other '\\') ('2m#g; t c # split combined\n') ('s#') (${ VSub_Name p) (0) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')#') (${ VSub_Name p) (Lit_Other '\\') ('1#g #strip leading 0\n') ('s#') (${ VSub_Name p) (1m) (Lit_Other '\\') ('(') (Lit_Other '\\') ('(') (${ VSub_Name p) ('[4579]m') (Lit_Other '\\') (')*') (Lit_Other '\\') (')#') (Lit_Other '\\') (1) (${ VSub_Name p) ('1m#g #bold last (with clr)\n') ('s#') (${ VSub_Name p) ('m#') (${ VSub_Name p) ('0m#g #add leading 0 to norm\n') ('\n') ('# undo any 256 color marking\n') ('s#') (${ VSub_Name p) ('\xc2\xac') (Lit_Other '\\') ('([34]8;5;[0-9]') (Lit_Other '\\') ('{1,3') (Lit_Other '\\') ('}') (Lit_Other '\\') (')m#') (${ VSub_Name p) (Lit_Other '\\') ('1m#g;\n') ('\n') ('# map 16 color codes to color + bold\n') ('s#') (${ VSub_Name p) (9) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m#') (${ VSub_Name p) (3) (Lit_Other '\\') (1m) (${ VSub_Name p) ('1m#g;\n') ('s#') (${ VSub_Name p) (10) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m#') (${ VSub_Name p) (4) (Lit_Other '\\') (1m) (${ VSub_Name p) ('1m#g;\n') ('\n') ("# change 'reset' code to ") (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('R\n') ('s#') (${ VSub_Name p) ('0m#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('R;#g\n') ) } ) (C {(sed)} { (DQ ('\n') ('# common combinations to minimise html (optional)\n') (':f\n') ('s#') (${ VSub_Name p) ('3[0-7]m') (${ VSub_Name p) (3) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m#') (${ VSub_Name p) (3) (Lit_Other '\\') ('1m#g; t f\n') (':b\n') ('s#') (${ VSub_Name p) ('4[0-7]m') (${ VSub_Name p) (4) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m#') (${ VSub_Name p) (4) (Lit_Other '\\') ('1m#g; t b\n') ('s#') (${ VSub_Name p) (3) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m') (${ VSub_Name p) (4) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (f) (Lit_Other '\\') ('1 b') (Lit_Other '\\') (2) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) (4) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m') (${ VSub_Name p) (3) (Lit_Other '\\') ('([0-7]') (Lit_Other '\\') (')m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (f) (Lit_Other '\\') ('2 b') (Lit_Other '\\') (1) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('\n') ('s#') (${ VSub_Name p) ('1m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (bold) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('4m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (underline) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('5m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (blink) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('7m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (reverse) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('9m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (line-through) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) (3) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') (')m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (f) (Lit_Other '\\') (1) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) (4) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') (')m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (b) (Lit_Other '\\') (1) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('\n') ('s#') (${ VSub_Name p) ('38;5;') (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,3') (Lit_Other '\\') ('}') (Lit_Other '\\') (')m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (ef) (Lit_Other '\\') (1) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('48;5;') (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,3') (Lit_Other '\\') ('}') (Lit_Other '\\') (')m#<span class=') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (eb) (Lit_Other '\\') (1) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('\n') ('s#') (${ VSub_Name p) ('[0-9;]*m##g # strip unhandled codes\n') ) } ) (C {(sed)} { (DQ ('\n') ("# change 'smacs' and 'rmacs' to ") (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('T1 and ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('T0 to simplify matching.\n') ('s#') (Lit_Other '\\') ('x1b(0#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('T1;#g;\n') ('s#') (Lit_Other '\\') ('x0E#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('T1;#g;\n') ('\n') ('s#') (Lit_Other '\\') ('x1b(B#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('T0;#g\n') ('s#') (Lit_Other '\\') ('x0F#') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('T0;#g\n') ) } ) (Subshell child: (C {(gawk)} { (SQ <'\n'> <'function dump_line(l,del,c,blanks,ret) {\n'> <' for(c=1;c<maxX;c++) {\n'> <' if ((c SUBSEP l) in attr || length(cur)) {\n'> <' ret = ret blanks fixas(cur,attr[c,l])\n'> <' if(del) delete attr[c,l]\n'> <' blanks=""\n'> <' }\n'> <' if ((c SUBSEP l) in dump) {\n'> <' ret=ret blanks dump[c,l]\n'> <' if(del) delete dump[c,l]\n'> <' blanks=""\n'> <' } else blanks=blanks " "\n'> <' }\n'> <' if(length(cur)) ret=ret blanks\n'> <' return ret\n'> <'}\n'> <'\n'> <'function dump_screen(l,ret) {\n'> <' for(l=1;l<=maxY;l++)\n'> <' ret=ret dump_line(l,0) "\\n"\n'> <' return ret fixas(cur, "")\n'> <'}\n'> <'\n'> <'function atos(a,i,ret) {\n'> <' for(i=1;i<=length(a);i++) if(i in a) ret=ret a[i]\n'> <' return ret\n'> <'}\n'> <'\n'> <'function fixas(a,s,spc,i,attr,rm,ret) {\n'> <' spc=length(a)\n'> <' l=split(s,attr,">")\n'> <' for(i=1;i<=spc;i++) {\n'> <' rm=rm?rm:(a[i]!=attr[i]">")\n'> <' if(rm) {\n'> <' ret=ret "</span>"\n'> <' delete a[i];\n'> <' }\n'> <' }\n'> <' for(i=1;i<l;i++) {\n'> <' attr[i]=attr[i]">"\n'> <' if(a[i]!=attr[i]) {\n'> <' a[i]=attr[i]\n'> <' ret = ret attr[i]\n'> <' }\n'> <' }\n'> <' return ret\n'> <'}\n'> <'\n'> <'function encode(string,start,end,i,ret,pos,sc,buf) {\n'> <' if(!end) end=length(string);\n'> <' if(!start) start=1;\n'> <' state=3\n'> <' for(i=1;i<=length(string);i++) {\n'> <' c=substr(string,i,1)\n'> <' if(state==2) {\n'> <' sc=sc c\n'> <' if(c==";") {\n'> <' c=sc\n'> <' state=last_mode\n'> <' } else continue\n'> <' } else {\n'> <' if(c=="\\r") { x=1; continue }\n'> <' if(c=="<") {\n'> <' # Change attributes - store current active\n'> <' # attributes in span array\n'> <' split(substr(string,i),cord,">");\n'> <' i+=length(cord[1])\n'> <' span[++spc]=cord[1] ">"\n'> <' continue\n'> <' }\n'> <' else if(c=="&") {\n'> <' # All goes to single position till we see a semicolon\n'> <' sc=c\n'> <' state=2\n'> <' continue\n'> <' }\n'> <' else if(c=="\\b") {\n'> <' # backspace move insertion point back 1\n'> <' if(spc) attr[x,y]=atos(span)\n'> <' x=x>1?x-1:1\n'> <' continue\n'> <' }\n'> <' else if(c=="\\"") {\n'> <' split(substr(string,i+2),cord,";")\n'> <' cc=substr(string,i+1,1);\n'> <' if(cc=="T") {\n'> <' # Transliterate on/off\n'> <' if(cord[1]==1&&state==3) last_mode=state=4\n'> <' if(cord[1]==0&&state==4) last_mode=state=3\n'> <' }\n'> <' else if(cc=="C") {\n'> <' # Clear\n'> <' if(cord[1]+0) {\n'> <' # Screen - if Recording dump screen\n'> <' if(dumpStatus==dsActive) ret=ret dump_screen()\n'> <' dumpStatus=dsActive\n'> <' delete dump\n'> <' delete attr\n'> <' x=y=1\n'> <' } else {\n'> <' # To end of line\n'> <' for(pos=x;pos<maxX;pos++) {\n'> <' dump[pos,y]=" "\n'> <' if (!spc) delete attr[pos,y]\n'> <' else attr[pos,y]=atos(span)\n'> <' }\n'> <' }\n'> <' }\n'> <' else if(cc=="J") {\n'> <' # Jump to x,y\n'> <' i+=length(cord[2])+1\n'> <' # If line is higher - dump previous screen\n'> <' if(dumpStatus==dsActive&&cord[1]<y) {\n'> <' ret=ret dump_screen();\n'> <' dumpStatus=dsNew;\n'> <' }\n'> <' x=cord[2]\n'> <' if(length(cord[1]) && y!=cord[1]){\n'> <' y=cord[1]\n'> <' if(y>maxY) maxY=y\n'> <' # Change y - start recording\n'> <' dumpStatus=dumpStatus?dumpStatus:dsReset\n'> <' }\n'> <' }\n'> <' else if(cc=="M") {\n'> <' # Move left/right on current line\n'> <' x+=cord[1]\n'> <' }\n'> <' else if(cc=="X") {\n'> <' # delete on right\n'> <' for(pos=x;pos<=maxX;pos++) {\n'> <' nx=pos+cord[1]\n'> <' if(nx<maxX) {\n'> <' if((nx SUBSEP y) in attr) attr[pos,y] = attr[nx,y]\n'> <' else delete attr[pos,y]\n'> <' if((nx SUBSEP y) in dump) dump[pos,y] = dump[nx,y]\n'> <' else delete dump[pos,y]\n'> <' } else if(spc) {\n'> <' attr[pos,y]=atos(span)\n'> <' dump[pos,y]=" "\n'> <' }\n'> <' }\n'> <' }\n'> <' else if(cc=="R") {\n'> <' # Reset attributes\n'> <' while(spc) delete span[spc--]\n'> <' }\n'> <' i+=length(cord[1])+2\n'> <' continue\n'> <' }\n'> <' else if(state==4&&i>=start&&i<=end&&c in Trans) c=Trans[c]\n'> <' }\n'> <' if(dumpStatus==dsReset) {\n'> <' delete dump\n'> <' delete attr\n'> <' ret=ret"\\n"\n'> <' dumpStatus=dsActive\n'> <' }\n'> <' if(dumpStatus==dsNew) {\n'> <' # After moving/clearing we are now ready to write\n'> <' # somthing to the screen so start recording now\n'> <' ret=ret"\\n"\n'> <' dumpStatus=dsActive\n'> <' }\n'> <' if(dumpStatus==dsActive||dumpStatus==dsOff) {\n'> <' dump[x,y] = c\n'> <' if(!spc) delete attr[x,y]\n'> <' else attr[x,y] = atos(span)\n'> <' if(++x>maxX) maxX=x;\n'> <' }\n'> <' }\n'> <' # End of line if dumping increment y and set x back to first col\n'> <' x=1\n'> <' if(!dumpStatus) return ret dump_line(y,1);\n'> <' else if(++y>maxY) maxY=y;\n'> <' return ret\n'> <'}\n'> <'BEGIN{\n'> <' OFS=FS\n'> <' # dump screen status\n'> <' dsOff=0 # Not dumping screen contents just write output direct\n'> <' dsNew=1 # Just after move/clear waiting for activity to start recording\n'> <' dsReset=2 # Screen cleared build new empty buffer and record\n'> <' dsActive=3 # Currently recording\n'> <' F="abcdefghijklmnopqrstuvwxyz{}`~"\n'> < ' T="\xe2\x96\x92\xe2\x90\x89\xe2\x90\x8c\xe2\x90\x8d\xe2\x90\x8a\xc2\xb0\xc2\xb1\xe2\x90\xa4\xe2\x90\x8b\xe2\x94\x98\xe2\x94\x90\xe2\x94\x8c\xe2\x94\x94\xe2\x94\xbc\xe2\x8e\xba\xe2\x8e\xbb\xe2\x94\x80\xe2\x8e\xbc\xe2\x8e\xbd\xe2\x94\x9c\xe2\x94\xa4\xe2\x94\xb4\xe2\x94\xac\xe2\x94\x82\xe2\x89\xa4\xe2\x89\xa5\xcf\x80\xc2\xa3\xe2\x97\x86\xc2\xb7"\n' > <' maxX=80\n'> <' delete cur;\n'> <' x=y=1\n'> <' for(i=1;i<=length(F);i++)Trans[substr(F,i,1)]=substr(T,i,1);\n'> <'}\n'> <'\n'> <'{ $0=encode($0) }\n'> <'1\n'> <'END {\n'> <' if(dumpStatus) {\n'> <' print dump_screen();\n'> <' }\n'> <'}'> ) } ) spids: [2370 2577] ) ] negated: False ) (AndOr children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$body_only'))} {(Lit_Other ']')}) (C {(printf)} {(SQ <'</pre>\n'> <'</body>\n'> <'</html>\\n'>)}) ] op_id: Op_DPipe ) ] )