aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexPython.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lexers/LexPython.cxx')
-rw-r--r--lexers/LexPython.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/lexers/LexPython.cxx b/lexers/LexPython.cxx
index 21a7fe5a8..2bb890875 100644
--- a/lexers/LexPython.cxx
+++ b/lexers/LexPython.cxx
@@ -309,6 +309,30 @@ struct OptionSetPython : public OptionSet<OptionsPython> {
const char styleSubable[] = { SCE_P_IDENTIFIER, 0 };
+LexicalClass lexicalClasses[] = {
+ // Lexer Python SCLEX_PYTHON SCE_P_:
+ 0, "SCE_P_DEFAULT", "default", "White space",
+ 1, "SCE_P_COMMENTLINE", "comment line", "Comment",
+ 2, "SCE_P_NUMBER", "literal numeric", "Number",
+ 3, "SCE_P_STRING", "literal string", "String",
+ 4, "SCE_P_CHARACTER", "literal string", "Single quoted string",
+ 5, "SCE_P_WORD", "keyword", "Keyword",
+ 6, "SCE_P_TRIPLE", "literal string", "Triple quotes",
+ 7, "SCE_P_TRIPLEDOUBLE", "literal string", "Triple double quotes",
+ 8, "SCE_P_CLASSNAME", "identifier", "Class name definition",
+ 9, "SCE_P_DEFNAME", "identifier", "Function or method name definition",
+ 10, "SCE_P_OPERATOR", "operator", "Operators",
+ 11, "SCE_P_IDENTIFIER", "identifier", "Identifiers",
+ 12, "SCE_P_COMMENTBLOCK", "comment", "Comment-blocks",
+ 13, "SCE_P_STRINGEOL", "error literal string", "End of line where string is not closed",
+ 14, "SCE_P_WORD2", "identifier", "Highlighted identifiers",
+ 15, "SCE_P_DECORATOR", "preprocessor", "Decorators",
+ 16, "SCE_P_FSTRING", "literal string interpolated", "F-String",
+ 17, "SCE_P_FCHARACTER", "literal string interpolated", "Single quoted f-string",
+ 18, "SCE_P_FTRIPLE", "literal string interpolated", "Triple quoted f-string",
+ 19, "SCE_P_FTRIPLEDOUBLE", "literal string interpolated", "Triple double quoted f-string",
+};
+
}
class LexerPython : public DefaultLexer {
@@ -321,6 +345,7 @@ class LexerPython : public DefaultLexer {
std::map<int, std::vector<SingleFStringExpState> > ftripleStateAtEol;
public:
explicit LexerPython() :
+ DefaultLexer(lexicalClasses, ELEMENTS(lexicalClasses)),
subStyles(styleSubable, 0x80, 0x40, 0) {
}
virtual ~LexerPython() {