wxMaxima
Loading...
Searching...
No Matches
Functions
MaximaProtocol.cpp File Reference

Implements the pure Maxima-protocol helpers. More...

#include "MaximaProtocol.h"
Include dependency graph for MaximaProtocol.cpp:
This graph shows which files directly or indirectly include this file:

Functions

bool MaximaProtocol::IsDebuggerPrompt (const wxString &label)
 A Maxima high-level debugger prompt, e.g. "(dbm:1)". Maxima drops into this REPL on an error while debugmode is on, or at a breakpoint.
 
bool MaximaProtocol::IsLispReplPrompt (const wxString &label)
 A Maxima Lisp-REPL prompt ("MAXIMA> "), as seen after to_lisp(). The prompt may be preceded by a newline in the stream.
 
bool MaximaProtocol::IsNumberedInputPrompt (const wxString &label)
 A normal numbered Maxima input/label prompt, e.g. "(%i3) " or "(%o12) ". The character before the closing ")" is a digit (any ibase) or A-Z. Excludes the debugger prompt (which also parenthesizes but is not an input prompt).
 
bool MaximaProtocol::IsMainInputPrompt (const wxString &label, bool inLispMode)
 Does label mark a new main prompt - one where wxMaxima should advance its evaluation queue - as opposed to a question it must stop and answer?
 
bool MaximaProtocol::CommandIsBlank (const wxString &command)
 Would transmitting command send nothing but a bare newline? SendMaxima trims trailing whitespace and appends "\n", so an empty or all-whitespace string becomes a lone blank line on the wire. At a normal Maxima prompt that is a harmless no-op, but at the "(dbm:N)" debugger prompt a blank line means "repeat the last command" - so a caller that has nothing to send must not call SendMaxima at all. Uses the same trim SendMaxima does.
 

Detailed Description

Implements the pure Maxima-protocol helpers.

See MaximaProtocol.h.

Function Documentation

◆ IsMainInputPrompt()

bool MaximaProtocol::IsMainInputPrompt ( const wxString &  label,
bool  inLispMode 
)

Does label mark a new main prompt - one where wxMaxima should advance its evaluation queue - as opposed to a question it must stop and answer?

True for a numbered input prompt, for anything while wxMaxima is already in Lisp mode, and for a Lisp-REPL prompt. The debugger prompt "(dbm:N)" is the one exception to the Lisp-mode clause: it is ALWAYS a question, never a main prompt, so that every debugger command is answered rather than mis-recorded as worksheet input. (A debugger session turns Lisp mode on, which used to make every "(dbm:N)" after the first classify as a main prompt.)