itom  4.1.0
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):
 
typedef QRegularExpression QQRegExp
 
- 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, bool outputNotError)
 
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 QRegExp regExpIdProg = QRegExp("\\s+(\\w+)")
 
static QRegExp regExpAsProg = QRegExp(".*?\\b(as)\\b")
 
static QQRegExp regExpOeComment = PythonSyntaxHighlighter::QQRegExp("^(// ?--[-]+|##[#]+ )[ -]*[^- ]+")
 

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
QRegExp m_regWhitespaces
 
QRegExp m_regSpacesPtrn
 
QSharedPointer< CodeEditorStylem_editorStyle
 
QSharedPointer< FoldDetectorm_foldDetector
 

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