Creates a new `CLEAR` command that resets the state of the machine.
(actions: Rc<RefCell<Vec<MachineAction>>>)
| 37 | impl ClearCommand { |
| 38 | /// Creates a new `CLEAR` command that resets the state of the machine. |
| 39 | pub fn new(actions: Rc<RefCell<Vec<MachineAction>>>) -> Rc<Self> { |
| 40 | Rc::from(Self { |
| 41 | metadata: CallableMetadataBuilder::new("CLEAR") |
| 42 | .with_async(true) |
| 43 | .with_syntax(&[(&[], None)]) |
| 44 | .with_category(CATEGORY) |
| 45 | .with_description( |
| 46 | "Restores initial machine state but keeps the stored program. |
| 47 | This command resets the machine to a semi-pristine state by clearing all user-defined variables \ |
| 48 | and restoring the state of shared resources. These resources include: the console, whose color \ |
| 49 | and video syncing bit are reset; and the GPIO pins, which are set to their default state. |
| 50 | The stored program is kept in memory. To clear that too, use NEW (but don't forget to first \ |
| 51 | SAVE your program!). |
| 52 | This command is for interactive use only.", |
| 53 | ) |
| 54 | .build(), |
| 55 | actions, |
| 56 | }) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | #[async_trait(?Send)] |
nothing calls this directly
no test coverage detected