QScintilla/Lexers/LexerPython.py

changeset 6874
5a3a39442711
parent 6873
47804e8cde27
child 6877
da5d6c7d5348
equal deleted inserted replaced
6873:47804e8cde27 6874:5a3a39442711
31 QsciLexerPython.__init__(self, parent) 31 QsciLexerPython.__init__(self, parent)
32 SubstyledLexer.__init__(self) 32 SubstyledLexer.__init__(self)
33 33
34 self.variant = variant 34 self.variant = variant
35 self.commentString = "#" 35 self.commentString = "#"
36
37 self.keywordSetDescriptions = [
38 self.tr("Keywords"),
39 self.tr("Highlighted identifiers"),
40 ]
36 41
37 ############################################################## 42 ##############################################################
38 ## default sub-style definitions 43 ## default sub-style definitions
39 ############################################################## 44 ##############################################################
40 45
217 @param kwSet number of the keyword set (integer) 222 @param kwSet number of the keyword set (integer)
218 @return string giving the keywords (string) or None 223 @return string giving the keywords (string) or None
219 """ 224 """
220 if kwSet == 1: 225 if kwSet == 1:
221 if self.language() in ["Python", "Python2"]: 226 if self.language() in ["Python", "Python2"]:
222 keywords = "and as assert break class continue def del elif " \ 227 keywords = ("and as assert break class continue def del elif "
223 "else except exec finally for from global if " \ 228 "else except exec finally for from global if "
224 "import in is lambda not or pass print raise " \ 229 "import in is lambda not or pass print raise "
225 "return try while with yield" 230 "return try while with yield cdef cimport cpdef")
226 elif self.language() == "Python3": 231 elif self.language() == "Python3":
227 keywords = "False None True and as assert break class " \ 232 keywords = ("False None True and as assert break class "
228 "continue def del elif else except finally for " \ 233 "continue def del elif else except finally for "
229 "from global if import in is lambda nonlocal not " \ 234 "from global if import in is lambda nonlocal not "
230 "or pass raise return try while with yield" 235 "or pass raise return try while with yield cdef "
236 "cimport cpdef")
231 else: 237 else:
232 keywords = QsciLexerPython.keywords(self, kwSet) 238 keywords = QsciLexerPython.keywords(self, kwSet)
233 239
234 return keywords 240 return keywords
235 241

eric ide

mercurial