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

Finds where in a code cell a Maxima syntax error is; see SyntaxErrorLocation.h. More...

#include "SyntaxErrorLocation.h"
#include <wx/tokenzr.h>
#include <wx/wxcrt.h>
#include <vector>
Include dependency graph for SyntaxErrorLocation.cpp:

Functions

std::optional< wxString > wxm::SyntaxErrorEcho (const wxString &maximaOutput)
 The line Maxima echoes under its first "incorrect syntax:" message.
 
std::optional< TextRange > wxm::LocateSyntaxError (const wxString &maximaOutput, const wxString &cellText, TextRange statement)
 Where in a cell the syntax error Maxima reported is.
 

Detailed Description

Finds where in a code cell a Maxima syntax error is; see SyntaxErrorLocation.h.

Function Documentation

◆ LocateSyntaxError()

std::optional< TextRange > wxm::LocateSyntaxError ( const wxString &  maximaOutput,
const wxString &  cellText,
TextRange  statement 
)

Where in a cell the syntax error Maxima reported is.

Parameters
maximaOutputEverything Maxima printed in reply to one statement.
cellTextThe text of the code cell the statement came from.
statementThe statement's characters in cellText.
Returns
The characters to mark: the token Maxima stopped at, plus the one character after it it may have read ahead. Nothing if Maxima did not report a syntax error, or the echoed text can't be found in the statement (for example because wxMaxima stripped a comment from it before sending it).

◆ SyntaxErrorEcho()

std::optional< wxString > wxm::SyntaxErrorEcho ( const wxString &  maximaOutput)

The line Maxima echoes under its first "incorrect syntax:" message.

Parameters
maximaOutputEverything Maxima printed in reply to one statement.
Returns
The echoed input line, exactly as Maxima printed it, or nothing if the output contains no complete syntax error report (the caret line is what tells that the echo is complete).