knitout_interpreter.debugger.common_debugging_conditions module
A library of common conditions for debugging steps and carriage-pass steps.
- is_instruction_type(_debugger, instruction, instruction_type)[source]
- Parameters:
_debugger (Knitout_Debugger) – The debugger calling the function.
instruction (Knitout_Comment_Line | Knitout_Instruction) – The instruction that will execute next.
instruction_type (type[Knitout_Line] | Iterable[type[Knitout_Line]]) – One or more types of instructions to compare to.
- Returns:
True if the next instruction is of the given instruction type(s) or one of their subclasses update the machine state of the process being debugged.
- Return type:
- is_not_instruction_type(_debugger, instruction, instruction_type)[source]
- Parameters:
_debugger (Knitout_Debugger) – The debugger calling the function.
instruction (Knitout_Comment_Line | Knitout_Instruction) – The instruction that will execute next.
instruction_type (type[Knitout_Line] | Iterable[type[Knitout_Line]]) – One or more types of instructions to compare to.
- Returns:
True if the next instruction not the given instruction type(s) or one of their subclasses update the machine state of the process being debugged.
- Return type:
- not_comment(_debugger, instruction)[source]
- Parameters:
_debugger (Knitout_Debugger) – The debugger calling the function.
instruction (Knitout_Comment_Line | Knitout_Instruction) – The instruction that will execute next.
- Returns:
True if the next instruction is an instruction (not a comment).
- Return type:
- will_update_machine_state(debugger, instruction)[source]
- Parameters:
debugger (Knitout_Debugger) – The debugger calling the function.
instruction (Knitout_Comment_Line | Knitout_Instruction) – The instruction that will execute next.
- Returns:
True if the next instruction will update the machine state of the process being debugged.
- Return type:
- loop_count_is(debugger, _instruction, loop_count)[source]
- Parameters:
debugger (Knitout_Debugger) – The debugger calling the function.
_instruction (Knitout_Comment_Line | Knitout_Instruction) – The instruction that will execute next.
loop_count (int) – The target count of loops in the knitgraph rendered by the debugged process.
- Returns:
True debugged process has produced exactly loop_count loops.
- Return type:
- loop_count_exceeds(debugger, _instruction, loop_count)[source]
- Parameters:
debugger (Knitout_Debugger) – The debugger calling the function.
_instruction (Knitout_Comment_Line | Knitout_Instruction) – The instruction that will execute next.
loop_count (int) – The target count of loops in the knitgraph rendered by the debugged process.
- Returns:
True debugged process has produced more than loop_count loops.
- Return type:
- loop_count_less_than(debugger, _instruction, loop_count)[source]
- Parameters:
debugger (Knitout_Debugger) – The debugger calling the function.
_instruction (Knitout_Comment_Line | Knitout_Instruction) – The instruction that will execute next.
loop_count (int) – The target count of loops in the knitgraph rendered by the debugged process.
- Returns:
True debugged process has produced less than loop_count loops.
- Return type: