Source Code (Use browser search to find items of interest.)

Class Index

kdevelop'PythonHighlight (./kdevelop/kdevelop/kwrite/highlight.h:485)

class PythonHighlight : public GenHighlight {
  public:
    PythonHighlight(const QString &name);
    virtual ~PythonHighlight();
  protected:
    virtual void createItemData(ItemDataList &);
    virtual void makeContextList();
};


kdevelop'PythonHighlight::PythonHighlight() (./kdevelop/kdevelop/kwrite/highlight.cpp:1396)

PythonHighlight::PythonHighlight(const QString &name) : GenHighlight(name) {
  iWildcards = "*.py";
  iMimetypes = "text/x-python-src";
}


kdevelop'PythonHighlight::~PythonHighlight() (./kdevelop/kdevelop/kwrite/highlight.cpp:1401)

PythonHighlight::~PythonHighlight() {
}


kdevelop'PythonHighlight::createItemData() (./kdevelop/kdevelop/kwrite/highlight.cpp:1404)

void PythonHighlight::createItemData(ItemDataList &list) {

  list.append(new ItemData(i18nop("Normal Text"),dsNormal));
  list.append(new ItemData(i18nop("Keyword"    ),dsKeyword));
  list.append(new ItemData(i18nop("Decimal"    ),dsDecVal));
  list.append(new ItemData(i18nop("Octal"      ),dsBaseN));
  list.append(new ItemData(i18nop("Hex"        ),dsBaseN));
  list.append(new ItemData(i18nop("Float"      ),dsFloat));
  list.append(new ItemData(i18nop("Char"       ),dsChar));
  list.append(new ItemData(i18nop("String"     ),dsString));
  list.append(new ItemData(i18nop("String Char"),dsChar));
  list.append(new ItemData(i18nop("Comment"    ),dsComment));
}


kdevelop'PythonHighlight::makeContextList() (./kdevelop/kdevelop/kwrite/highlight.cpp:1418)

void PythonHighlight::makeContextList() {
  HlContext *c;
  HlKeyword *keyword;

  //note that a C octal has to be detected before an int and """ before "
  contextList[0] = c = new HlContext(0,0);
    c->items.append(keyword = new HlKeyword(1,0));
    c->items.append(new HlCOct(3,0));
    c->items.append(new HlInt(2,0));
    c->items.append(new HlCHex(4,0));
    c->items.append(new HlFloat(5,0));
    c->items.append(new HlCChar(6,0));
    c->items.append(new HlStringDetect(7,3,"\"\"\""));
    c->items.append(new HlStringDetect(7,4,"\'\'\'"));
    c->items.append(new HlCharDetect(7,1,'"'));
    c->items.append(new HlCharDetect(7,2,'\''));
    c->items.append(new HlCharDetect(9,5,'#'));
  contextList[1] = c = new HlContext(7,0);
    c->items.append(new HlLineContinue(7,6));
    c->items.append(new HlCStringChar(8,1));
    c->items.append(new HlCharDetect(7,0,'"'));
  contextList[2] = c = new HlContext(7,0);
    c->items.append(new HlLineContinue(7,7));
    c->items.append(new HlCStringChar(8,2));
    c->items.append(new HlCharDetect(7,0,'\''));
  contextList[3] = c = new HlContext(7,3);
    c->items.append(new HlStringDetect(7,0,"\"\"\""));
  contextList[4] = c = new HlContext(7,4);
    c->items.append(new HlStringDetect(7,0,"\'\'\'"));
  contextList[5] = new HlContext(9,0);
  contextList[6] = new HlContext(0,1);
  contextList[7] = new HlContext(0,2);

  keyword->addList(pythonKeywords);
}