itom
Loading...
Searching...
No Matches
ito::PythonSyntaxHighlighter Class Reference
Inheritance diagram for ito::PythonSyntaxHighlighter:
ito::SyntaxHighlighterBase ito::Mode

Classes

struct  NamedRegExp
 

Public Types

enum  State {
  Normal = 0 , InsideSq3String = 1 , InsideDq3String = 2 , InsideSqString = 3 ,
  InsideDqString = 4
}
 < Syntax highlighting states (from one text block to another):
 
- Public Types inherited from ito::Mode
typedef QSharedPointer< ModePtr
 

Public Member Functions

 PythonSyntaxHighlighter (QTextDocument *parent, const QString &description="", QSharedPointer< CodeEditorStyle > editorStyle=QSharedPointer< CodeEditorStyle >())
 
void highlight_block (const QString &text, QTextBlock &block)
 
void default_highlight_block (const QString &text, const TextBlockUserData *textBlockUserData)
 
virtual void rehighlight ()
 
- Public Member Functions inherited from ito::SyntaxHighlighterBase
 SyntaxHighlighterBase (const QString &name, QTextDocument *parent, const QString &description="", QSharedPointer< CodeEditorStyle > editorStyle=QSharedPointer< CodeEditorStyle >())
 
void setFoldDetector (QSharedPointer< FoldDetector > foldDetector)
 
virtual void onStateChanged (bool state)
 
virtual void onInstall (CodeEditor *editor)
 
QSharedPointer< CodeEditorStyleeditorStyle () const
 
void highlightBlock (const QString &text)
 
void refreshEditor (QSharedPointer< CodeEditorStyle > editorStyle)
 
- Public Member Functions inherited from ito::Mode
 Mode (const Mode &copy)
 
 Mode (const QString &name, const QString &description="")
 
bool operator== (const Mode &other) const
 
virtual void onUninstall ()
 
QString name () const
 
bool enabled () const
 
void setEnabled (bool enabled)
 
CodeEditoreditor () const
 
bool onClose () const
 
virtual QList< QAction * > actions () const
 

Private Member Functions

QTextCharFormat getFormatFromStyle (StyleItem::StyleType token) const
 
const QTextCharFormat getTextCharFormat (const QString &colorName, const QString &style=QString())
 

Static Private Member Functions

static QList< NamedRegExpmakePythonPatterns (const QStringList &additionalKeywords=QStringList(), const QStringList &additionalBuiltins=QStringList())
 

Static Private Attributes

static QList< NamedRegExpregExpProg = PythonSyntaxHighlighter::makePythonPatterns()
 
static QRegularExpression regExpIdProg = QRegularExpression("\\s+(\\w+)")
 
static QRegularExpression regExpAsProg = QRegularExpression(".*?\\b(as)\\b")
 
static QRegularExpression regExpOeComment = QRegularExpression("^(// ?--[-]+|##[#]+ )[ -]*[^- ]+")
 

Additional Inherited Members

- Protected Member Functions inherited from ito::SyntaxHighlighterBase
void highlightWhitespaces (const QString &text)
 
- Static Protected Member Functions inherited from ito::SyntaxHighlighterBase
static QTextBlock findPrevNonBlankBlock (const QTextBlock &currentBlock)
 
- Protected Attributes inherited from ito::SyntaxHighlighterBase
QRegularExpression m_regWhitespaces
 
QRegularExpression m_regSpacesPtrn
 
QSharedPointer< CodeEditorStylem_editorStyle
 
QSharedPointer< FoldDetectorm_foldDetector
 

Member Function Documentation

◆ default_highlight_block()

void ito::PythonSyntaxHighlighter::default_highlight_block ( const QString & text,
const TextBlockUserData * textBlockUserData )
virtual

◆ highlight_block()

void ito::PythonSyntaxHighlighter::highlight_block ( const QString & text,
QTextBlock & block )
virtual

◆ rehighlight()

void ito::PythonSyntaxHighlighter::rehighlight ( )
virtual

Reimplemented from ito::SyntaxHighlighterBase.


The documentation for this class was generated from the following files: