File: EclipsePythonThemeImporter.cpp

package info (click to toggle)
codelite 12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (40 lines) | stat: -rw-r--r-- 2,802 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "EclipsePythonThemeImporter.h"

EclipsePythonThemeImporter::EclipsePythonThemeImporter()
{
    SetKeywords0("and as assert break class continue def del elif else except exec finally for from global if import in "
                 "is lambda not or pass print raise return try while with yield");
    SetKeywords1("bool bytes bytearray dict float frozenset int list long set str tuple type unicode");
    SetKeywords2("__import__ abs all any ascii bin callable chr classmethod compile complex delattr dir divmod "
                 "enumerate eval filter format getattr globals hasattr hash help hex id input isinstance issubclass "
                 "iter len locals map max memoryview min next object oct open ord pow property range raw_input repr "
                 "reversed round setattr slice sorted staticmethod sum super vars zip");
    SetKeywords3("True False None");
    SetFileExtensions("*.py;waf;wscript;wscript_build");
    m_langName = "python";
}

EclipsePythonThemeImporter::~EclipsePythonThemeImporter() {}

LexerConf::Ptr_t EclipsePythonThemeImporter::Import(const wxFileName& eclipseXmlFile)
{
    LexerConf::Ptr_t lexer = InitializeImport(eclipseXmlFile, GetLangName(), wxSTC_LEX_PYTHON);
    AddProperty(lexer, wxSTC_P_DEFAULT, "Default", m_foreground.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_COMMENTLINE, "Comment", m_singleLineComment.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_COMMENTLINE, "Number", m_number.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_STRING, "String", m_string.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_CHARACTER, "Character", m_string.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_WORD, "Word", m_keyword.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_TRIPLE, "Triple", m_multiLineComment.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_TRIPLEDOUBLE, "Double Triple", m_multiLineComment.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_CLASSNAME, "Class Name", m_klass.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_DEFNAME, "Def Name", m_variable.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_OPERATOR, "Operator", m_foreground.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_IDENTIFIER, "Identifier", m_foreground.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_COMMENTBLOCK, "Comment block", m_multiLineComment.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_STRINGEOL, "String EOL", m_string.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_WORD2, "Word 2", m_keyword.colour, m_background.colour);
    AddProperty(lexer, wxSTC_P_DECORATOR, "Decorator", m_klass.colour, m_background.colour);
    FinalizeImport(lexer);
    return lexer;
}