(command.CommandList children: [ (command.AndOr ops: [Op_DPipe] children: [ (command.Simple words: [{(gawk)} {(--version)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ (--version))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(printf)} {(SQ <'0.23\\n'>)}) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) ] ) (command.ShFunction name: usage body: (command.BraceGroup children: [ (command.Simple 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.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ (--help))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)})] ) ] ) (command.ShFunction name: processArg body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ ('--bg=dark'))} {(Lit_RBracket ']')} ) (command.BraceGroup children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dark_bg) op: Equal rhs: {(yes)} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ (--css-only))} {(Lit_RBracket ']')} ) (command.BraceGroup children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:css_only) op: Equal rhs: {(yes)} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ (--body-only))} {(Lit_RBracket ']')} ) (command.BraceGroup children: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:body_only) op: Equal rhs: {(yes)} ) ] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ ('--palette=solarized'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P0) op:Equal rhs:{(073642)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P1) op:Equal rhs:{(D30102)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P2) op:Equal rhs:{(859900)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P3) op:Equal rhs:{(B58900)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P4) op:Equal rhs:{(268BD2)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P5) op:Equal rhs:{(D33682)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P6) op:Equal rhs:{(2AA198)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P7) op:Equal rhs:{(EEE8D5)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P8) op:Equal rhs:{(002B36)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P9) op:Equal rhs:{(CB4B16)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P10) op:Equal rhs:{(586E75)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P11) op:Equal rhs:{(657B83)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P12) op:Equal rhs:{(839496)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P13) op:Equal rhs:{(6C71C4)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P14) op:Equal rhs:{(93A1A1)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P15) op:Equal rhs:{(FDF6E3)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] ) (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ ('--palette=solarized-xterm'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P0) op:Equal rhs:{(262626)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P1) op:Equal rhs:{(AF0000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P2) op:Equal rhs:{(5F8700)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P3) op:Equal rhs:{(AF8700)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P4) op:Equal rhs:{(0087FF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P5) op:Equal rhs:{(AF005F)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P6) op:Equal rhs:{(00AFAF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P7) op:Equal rhs:{(E4E4E4)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P8) op:Equal rhs:{(1C1C1C)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P9) op:Equal rhs:{(D75F00)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P10) op:Equal rhs:{(585858)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P11) op:Equal rhs:{(626262)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P12) op:Equal rhs:{(808080)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P13) op:Equal rhs:{(5F5FAF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P14) op:Equal rhs:{(8A8A8A)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P15) op:Equal rhs:{(FFFFD7)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] ) (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ ('--palette=tango'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P0) op:Equal rhs:{(000000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P1) op:Equal rhs:{(CC0000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P2) op:Equal rhs:{(4E9A06)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P3) op:Equal rhs:{(C4A000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P4) op:Equal rhs:{(3465A4)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P5) op:Equal rhs:{(75507B)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P6) op:Equal rhs:{(06989A)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P7) op:Equal rhs:{(D3D7CF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P8) op:Equal rhs:{(555753)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P9) op:Equal rhs:{(EF2929)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P10) op:Equal rhs:{(8AE234)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P11) op:Equal rhs:{(FCE94F)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P12) op:Equal rhs:{(729FCF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P13) op:Equal rhs:{(AD7FA8)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P14) op:Equal rhs:{(34E2E2)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P15) op:Equal rhs:{(EEEEEC)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] ) (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ ('--palette=xterm'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P0) op:Equal rhs:{(000000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P1) op:Equal rhs:{(CD0000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P2) op:Equal rhs:{(00CD00)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P3) op:Equal rhs:{(CDCD00)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P4) op:Equal rhs:{(0000EE)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P5) op:Equal rhs:{(CD00CD)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P6) op:Equal rhs:{(00CDCD)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P7) op:Equal rhs:{(E5E5E5)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P8) op:Equal rhs:{(7F7F7F)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P9) op:Equal rhs:{(FF0000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P10) op:Equal rhs:{(00FF00)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P11) op:Equal rhs:{(FFFF00)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P12) op:Equal rhs:{(5C5CFF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P13) op:Equal rhs:{(FF00FF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P14) op:Equal rhs:{(00FFFF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P15) op:Equal rhs:{(FFFFFF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ControlFlow token:<ControlFlow_Return return>) terminator: <Op_Semi ';'> ) ] ) ] else_action: [ (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P0) op:Equal rhs:{(000000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P1) op:Equal rhs:{(AA0000)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P2) op:Equal rhs:{(00AA00)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P3) op:Equal rhs:{(AA5500)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P4) op:Equal rhs:{(0000AA)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P5) op:Equal rhs:{(AA00AA)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P6) op:Equal rhs:{(00AAAA)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P7) op:Equal rhs:{(AAAAAA)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P8) op:Equal rhs:{(555555)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P9) op:Equal rhs:{(FF5555)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P10) op:Equal rhs:{(55FF55)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P11) op:Equal rhs:{(FFFF55)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P12) op:Equal rhs:{(5555FF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P13) op:Equal rhs:{(FF55FF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P14) op:Equal rhs:{(55FFFF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:P15) op:Equal rhs:{(FFFFFF)})] ) terminator: <Op_Semi ';'> ) (command.Sentence child: (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ ('--palette=linux'))} {(Lit_RBracket ']')} ) (command.ControlFlow token: <ControlFlow_Return return> ) ] ) terminator: <Op_Semi ';'> ) ] ) ] ) ) (C {(processArg)}) (command.ForEach iter_name: var iter_words: [{(DQ ($ VSub_At '$@'))}] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (C {(processArg)} {($ VSub_DollarName '$var')}) terminator: <Op_Semi ';'> ) ] ) ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$css_only'))} {(Lit_RBracket ']')}) (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(usage)}) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(sed)} {(--version)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [{(gsed)} {(--version)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [(C {(alias)} {(Lit_VarLike 'sed=') (gsed)})] ) ] else_action: [ (command.Simple words: [{(echo)} {(DQ ("Error, can't find an acceptable GNU sed."))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) ] ) (command.AndOr ops: [Op_DPipe Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$css_only'))} {(Lit_RBracket ']')}) (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(printf)} {(SQ <'%s'>)} { (DQ ('<html>\n') ('<head>\n') ('<meta http-equiv=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (Content-Type) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (' content=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('text/html; charset=utf-8') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('/>\n') ('<style type=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (text/css) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>\n') ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(printf)} { (DQ ('.ef0,.f0 { color: #') ($ VSub_DollarName '$P0') ('; } .eb0,.b0 { background-color: #') ($ VSub_DollarName '$P0') ('; }\n') ('.ef1,.f1 { color: #') ($ VSub_DollarName '$P1') ('; } .eb1,.b1 { background-color: #') ($ VSub_DollarName '$P1') ('; }\n') ('.ef2,.f2 { color: #') ($ VSub_DollarName '$P2') ('; } .eb2,.b2 { background-color: #') ($ VSub_DollarName '$P2') ('; }\n') ('.ef3,.f3 { color: #') ($ VSub_DollarName '$P3') ('; } .eb3,.b3 { background-color: #') ($ VSub_DollarName '$P3') ('; }\n') ('.ef4,.f4 { color: #') ($ VSub_DollarName '$P4') ('; } .eb4,.b4 { background-color: #') ($ VSub_DollarName '$P4') ('; }\n') ('.ef5,.f5 { color: #') ($ VSub_DollarName '$P5') ('; } .eb5,.b5 { background-color: #') ($ VSub_DollarName '$P5') ('; }\n') ('.ef6,.f6 { color: #') ($ VSub_DollarName '$P6') ('; } .eb6,.b6 { background-color: #') ($ VSub_DollarName '$P6') ('; }\n') ('.ef7,.f7 { color: #') ($ VSub_DollarName '$P7') ('; } .eb7,.b7 { background-color: #') ($ VSub_DollarName '$P7') ('; }\n') ('.ef8, .f0 > .bold,.bold > .f0 { color: #') ($ VSub_DollarName '$P8') ('; font-weight: normal; }\n') ('.ef9, .f1 > .bold,.bold > .f1 { color: #') ($ VSub_DollarName '$P9') ('; font-weight: normal; }\n') ('.ef10,.f2 > .bold,.bold > .f2 { color: #') ($ VSub_DollarName '$P10') ('; font-weight: normal; }\n') ('.ef11,.f3 > .bold,.bold > .f3 { color: #') ($ VSub_DollarName '$P11') ('; font-weight: normal; }\n') ('.ef12,.f4 > .bold,.bold > .f4 { color: #') ($ VSub_DollarName '$P12') ('; font-weight: normal; }\n') ('.ef13,.f5 > .bold,.bold > .f5 { color: #') ($ VSub_DollarName '$P13') ('; font-weight: normal; }\n') ('.ef14,.f6 > .bold,.bold > .f6 { color: #') ($ VSub_DollarName '$P14') ('; font-weight: normal; }\n') ('.ef15,.f7 > .bold,.bold > .f7 { color: #') ($ VSub_DollarName '$P15') ('; font-weight: normal; }\n') ('.eb8 { background-color: #') ($ VSub_DollarName '$P8') ('; }\n') ('.eb9 { background-color: #') ($ VSub_DollarName '$P9') ('; }\n') ('.eb10 { background-color: #') ($ VSub_DollarName '$P10') ('; }\n') ('.eb11 { background-color: #') ($ VSub_DollarName '$P11') ('; }\n') ('.eb12 { background-color: #') ($ VSub_DollarName '$P12') ('; }\n') ('.eb13 { background-color: #') ($ VSub_DollarName '$P13') ('; }\n') ('.eb14 { background-color: #') ($ VSub_DollarName '$P14') ('; }\n') ('.eb15 { background-color: #') ($ VSub_DollarName '$P15') ('; }\n') ) } ) ] ) (command.ForEach iter_name: red iter_words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: green iter_words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ForEach iter_name: blue iter_words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)}] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:c) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{(Lit_Digits 16)}) right: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w: {($ VSub_DollarName '$red')} ) right: (arith_expr.ArithWord w: {(Lit_Digits 36)} ) ) ) right: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w: {($ VSub_DollarName '$green')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 6)}) ) ) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$blue')} ) ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:r) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w: {($ VSub_DollarName '$red')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 40)}) ) right: (arith_expr.ArithWord w:{(Lit_Digits 55)}) ) right: (arith_expr.Binary op_id: Arith_Great left: (arith_expr.ArithWord w: {($ VSub_DollarName '$red')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:g) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w: {($ VSub_DollarName '$green')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 40)}) ) right: (arith_expr.ArithWord w:{(Lit_Digits 55)}) ) right: (arith_expr.Binary op_id: Arith_Great left: (arith_expr.ArithWord w: {($ VSub_DollarName '$green')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:b) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w: {($ VSub_DollarName '$blue')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 40)}) ) right: (arith_expr.ArithWord w:{(Lit_Digits 55)}) ) right: (arith_expr.Binary op_id: Arith_Great left: (arith_expr.ArithWord w: {($ VSub_DollarName '$blue')} ) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')} ) (C {(printf)} {(DQ ('.ef%d { color: #%2.2x%2.2x%2.2x; } '))} {($ VSub_DollarName '$c')} {($ VSub_DollarName '$r')} {($ VSub_DollarName '$g')} {($ VSub_DollarName '$b')} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')} ) (C {(printf)} { (DQ ('.eb%d { background-color: #%2.2x%2.2x%2.2x; }') (Lit_Other '\\') (n) ) } {($ VSub_DollarName '$c')} {($ VSub_DollarName '$r')} {($ VSub_DollarName '$g')} {($ VSub_DollarName '$b')} ) ] ) ] ) ) ] ) ) ] ) ) (command.ForEach iter_name: gray iter_words: [ { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children:[(C {(seq)} {(0)} {(23)})]) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:c) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$gray')}) right: (arith_expr.ArithWord w:{(Lit_Digits 232)}) ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:l) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.ArithWord w:{($ VSub_DollarName '$gray')}) right: (arith_expr.ArithWord w:{(Lit_Digits 10)}) ) right: (arith_expr.ArithWord w:{(Lit_Digits 8)}) ) ) } ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(printf)} {(DQ ('.ef%d { color: #%2.2x%2.2x%2.2x; } '))} {($ VSub_DollarName '$c')} {($ VSub_DollarName '$l')} {($ VSub_DollarName '$l')} {($ VSub_DollarName '$l')} ) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(printf)} {(DQ ('.eb%d { background-color: #%2.2x%2.2x%2.2x; }') (Lit_Other '\\') (n))} {($ VSub_DollarName '$c')} {($ VSub_DollarName '$l')} {($ VSub_DollarName '$l')} {($ VSub_DollarName '$l')} ) ] ) ] ) ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(printf)} {(SQ <'%s'>)} {(SQ <'\n'> <'.f9 { color: '>) (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$dark_bg'))} {(Lit_RBracket ']')} ) (C {(printf)} {(DQ ('#') ($ VSub_DollarName '$P7') (';'))}) (C {(printf)} {(DQ ('#') ($ VSub_DollarName '$P0') (';'))}) ] ) ] ) ) (SQ <' }\n'> <'.b9 { background-color: #'>) (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$dark_bg'))} {(Lit_RBracket ']')} ) (C {(printf)} {($ VSub_DollarName '$P0')}) (C {(printf)} {($ VSub_DollarName '$P15')}) ] ) ] ) ) (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: '> ) (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$dark_bg'))} {(Lit_RBracket ']')} ) (C {(printf)} {(DQ ('#') ($ VSub_DollarName '$P15') (';'))}) (C {(printf)} {(DQ ('#') ($ VSub_DollarName '$P0') (';'))}) ] ) ] ) ) (SQ <'\n'> <' font-weight: '>) (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$dark_bg'))} {(Lit_RBracket ']')} ) (C {(printf)} {(SQ <'normal;'>)}) (C {(printf)} {(SQ <'bold;'>)}) ] ) ] ) ) (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_DollarName '$P0') ('; background-color: #') ($ VSub_DollarName '$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'> ) } ) ] ) (command.AndOr ops: [Op_DPipe Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$css_only'))} {(Lit_RBracket ']')}) (command.Simple 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.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$css_only'))} {(Lit_RBracket ']')}) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(printf)} {(SQ <'%s'>)} {(SQ <'</style>\n'> <'</head>\n'> <'\n'> <'<body class="f9 b9">\n'> <'<pre>\n'>)} ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (command.Simple words: [{(printf)} {(SQ <'%s\\n'>)} {(SQ <'Be sure to use <body class="f9 b9"> and <pre>'>)}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:p) op:Equal rhs:{(SQ <'\\x1b\\['>)})] ) (command.Pipeline children: [ (C {(sed)} { (DQ ('\n') ('# escape ampersand and quote\n') ('s#&#') (Lit_Other '\\') ('&#g; s#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('#') (Lit_Other '\\') ('"#g;\n') ('s#') (Lit_Other '\\') ('x1b[^') (Lit_Other '\\') ('x1b]*') (Lit_Other '\\') (x1b) (word_part.EscapedLiteral 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) (word_part.EscapedLiteral 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 ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('Jr;c;\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,2') (Lit_Other '\\') ('}') (Lit_Other '\\') (')G#') (word_part.EscapedLiteral 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#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (J) (Lit_Other '\\') ('1;') (Lit_Other '\\') ('2;#g\n') ('\n') ('# Mark clear as ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('Cn where n=1 is screen and n=0 is to end-of-line\n') ('s#') (${ VSub_Name p) ('H#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('C1;#g\n') ('s#') (${ VSub_Name p) ('K#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('C0;#g\n') ('# Mark Cursor move columns as ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('Mn where n is +ve for right, -ve for left\n') ('s#') (${ VSub_Name p) ('C#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('M1;#g\n') ('s#') (${ VSub_Name p) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') ('{1,') (Lit_Other '\\') ('}') (Lit_Other '\\') (')C#') (word_part.EscapedLiteral 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#') (word_part.EscapedLiteral 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#') (word_part.EscapedLiteral 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 ") (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('R\n') ('s#') (${ VSub_Name p) ('0m#') (word_part.EscapedLiteral 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=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (f) (Lit_Other '\\') ('1 b') (Lit_Other '\\') (2) (word_part.EscapedLiteral 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=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (f) (Lit_Other '\\') ('2 b') (Lit_Other '\\') (1) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('\n') ('s#') (${ VSub_Name p) ('1m#<span class=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (bold) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('4m#<span class=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (underline) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('5m#<span class=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (blink) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('7m#<span class=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (reverse) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) ('9m#<span class=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (line-through) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) (3) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') (')m#<span class=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (f) (Lit_Other '\\') (1) (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('>#g\n') ('s#') (${ VSub_Name p) (4) (Lit_Other '\\') ('([0-9]') (Lit_Other '\\') (')m#<span class=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (b) (Lit_Other '\\') (1) (word_part.EscapedLiteral 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=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (ef) (Lit_Other '\\') (1) (word_part.EscapedLiteral 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=') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) (eb) (Lit_Other '\\') (1) (word_part.EscapedLiteral 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 ") (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('T1 and ') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('T0 to simplify matching.\n') ('s#') (Lit_Other '\\') ('x1b(0#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('T1;#g;\n') ('s#') (Lit_Other '\\') ('x0E#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('T1;#g;\n') ('\n') ('s#') (Lit_Other '\\') ('x1b(B#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('T0;#g\n') ('s#') (Lit_Other '\\') ('x0F#') (word_part.EscapedLiteral token:<Lit_EscapedChar '\\"'>) ('T0;#g\n') ) } ) (command.Subshell command_list: (command.CommandList children: [ (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'> <'}'> ) } ) ] ) ) ] negated: F ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$body_only'))} {(Lit_RBracket ']')}) (C {(printf)} {(SQ <'</pre>\n'> <'</body>\n'> <'</html>\\n'>)}) ] ) ] )