LexerPython: made the list of default keywords dynamic getting them from the keyword module and introduced a separate list for MicroPython.

Sun, 02 Aug 2020 17:19:20 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 02 Aug 2020 17:19:20 +0200
changeset 7658
3975d0659673
parent 7657
428836188b88
child 7659
60ee4dc1ce06

LexerPython: made the list of default keywords dynamic getting them from the keyword module and introduced a separate list for MicroPython.

eric6/QScintilla/Lexers/LexerPython.py file | annotate | diff | comparison | revisions
--- a/eric6/QScintilla/Lexers/LexerPython.py	Sat Aug 01 11:16:56 2020 +0200
+++ b/eric6/QScintilla/Lexers/LexerPython.py	Sun Aug 02 17:19:20 2020 +0200
@@ -234,6 +234,9 @@
         """
         if kwSet == 1:
             if self.language() == "Python3":
+                import keyword
+                keywords = " ".join(keyword.kwlist)
+            elif self.language() == "MicroPython":
                 keywords = ("False None True and as assert break class "
                             "continue def del elif else except finally for "
                             "from global if import in is lambda nonlocal not "

eric ide

mercurial