src/eric7/QScintilla/Lexers/LexerPython.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9484
d2eb8f0a5bf0
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
6 """ 6 """
7 Module implementing a Python lexer with some additional methods. 7 Module implementing a Python lexer with some additional methods.
8 """ 8 """
9 9
10 import contextlib 10 import contextlib
11 import keyword
11 import re 12 import re
12 13
13 from PyQt6.Qsci import QsciLexerPython, QsciScintilla 14 from PyQt6.Qsci import QsciLexerPython, QsciScintilla
14 15
15 from eric7 import Preferences 16 from eric7 import Preferences
231 @param kwSet number of the keyword set (integer) 232 @param kwSet number of the keyword set (integer)
232 @return string giving the keywords (string) or None 233 @return string giving the keywords (string) or None
233 """ 234 """
234 if kwSet == 1: 235 if kwSet == 1:
235 if self.language() == "Python3": 236 if self.language() == "Python3":
236 import keyword
237
238 keywords = " ".join(keyword.kwlist) 237 keywords = " ".join(keyword.kwlist)
239 elif self.language() == "MicroPython": 238 elif self.language() == "MicroPython":
240 keywords = ( 239 keywords = (
241 "False None True and as assert break class " 240 "False None True and as assert break class "
242 "continue def del elif else except finally for " 241 "continue def del elif else except finally for "

eric ide

mercurial