# -*- shell-script -*- # "set annotate" debugger command # # Copyright (C) 2010-2011, 2016 Rocky Bernstein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place, Suite 330, Boston, # MA 02111 USA. _Dbg_help_add_sub set annotate \ '**set annotate** {**0**|**1**} Set annotation level. 0 - normal 1 - fullname (for use when running under emacs). See also: --------- **show annotate** ''Set annotation level [N] ' 1 proc _Dbg_do_set_annotate { eval $_seteglob if (( $# != 1 )) { _Dbg_msg "A single argument is required (got $Argc arguments)." } elif [[ $1 == $int_pat ]] { if (( $1 > 3 )) { _Dbg_msg "Annotation level must be between 0 and 3. Got: $(1)." } else { _Dbg_write_journal_eval "_Dbg_set_annotate=$1" } } else { eval $_resteglob _Dbg_msg "Integer argument expected; got: $1" return 1 } eval $_resteglob return 0 } (CommandList children: [ (C {(_Dbg_help_add_sub)} {(set)} {(annotate)} { (SQ <"**set annotate** {**0**|**1**}\n"> <"\n"> <"Set annotation level.\n"> <"\n"> <" 0 - normal\n"> <" 1 - fullname (for use when running under emacs).\n"> <"\n"> <"See also:\n"> <"---------\n"> <"\n"> <"**show annotate**\n"> ) (SQ <"Set annotation level [N]\n">) } {(1)} ) (FuncDef name: _Dbg_do_set_annotate body: (BraceGroup children: [ (C {(eval)} {(DQ ($ VSub_Name "$_seteglob"))}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_NEqual left: (ArithWord w:{($ VSub_Pound "$#")}) right: (ArithWord w:{(Lit_Digits 1)}) ) ) terminator: ) ] action: [ (C {(_Dbg_msg)} { (DQ ("A single argument is required (got ") ($ VSub_Pound "$#") (" arguments).") ) } ) ] spids: [-1 114] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number "$1")} right: {($ VSub_Name "$int_pat")} ) ) terminator: ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w:{($ VSub_Number "$1")}) right: (ArithWord w:{(Lit_Digits 3)}) ) ) terminator: ) ] action: [ (C {(_Dbg_msg)} { (DQ ("Annotation level must be between 0 and 3. Got: ") (${ VSub_Number 1) (.) ) } ) ] spids: [-1 158] ) ] else_action: [ (C {(_Dbg_write_journal_eval)} {(DQ ("_Dbg_set_annotate=") ($ VSub_Number "$1"))} ) ] spids: [172 183] ) ] spids: [126 140] ) ] else_action: [ (C {(eval)} {(DQ ($ VSub_Name "$_resteglob"))}) (C {(_Dbg_msg)} {(DQ ("Integer argument expected; got: ") ($ VSub_Number "$1"))}) (ControlFlow token: arg_word:{(1)}) ] spids: [186 209] ) (C {(eval)} {(DQ ($ VSub_Name "$_resteglob"))}) (ControlFlow token: arg_word:{(0)}) ] spids: [89] ) spids: [85 88] ) ] )