diff options
| author | mitchell <unknown> | 2020-06-02 14:31:28 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2020-06-02 14:31:28 -0400 |
| commit | 45d4e27aed4e2301a2dd00d8ee59174ff2a2f0db (patch) | |
| tree | c614d01fc6381a84f9e6332161c71f2c13fd0c81 /lexlib | |
| parent | 60b53eebcce8b069bc9d9c863f9fa283416eeacd (diff) | |
| download | scintilla-mirror-45d4e27aed4e2301a2dd00d8ee59174ff2a2f0db.tar.gz | |
Initial, experimental support for upstream ILexer5/lexilla lexers.
Diffstat (limited to 'lexlib')
| -rw-r--r-- | lexlib/LexerModule.cxx | 5 | ||||
| -rw-r--r-- | lexlib/LexerModule.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lexlib/LexerModule.cxx b/lexlib/LexerModule.cxx index 30e8cf041..592b53871 100644 --- a/lexlib/LexerModule.cxx +++ b/lexlib/LexerModule.cxx @@ -35,6 +35,7 @@ LexerModule::LexerModule(int language_, fnLexer(fnLexer_), fnFolder(fnFolder_), fnFactory(nullptr), + fnFactory5(nullptr), wordListDescriptions(wordListDescriptions_), lexClasses(lexClasses_), nClasses(nClasses_), @@ -58,7 +59,7 @@ LexerModule::LexerModule(int language_, LexerModule::~LexerModule() { } -int LexerModule::GetLanguage() const { +int LexerModule::GetLanguage() const { return language; } @@ -96,6 +97,8 @@ size_t LexerModule::NamedStyles() const { ILexer *LexerModule::Create() const { if (fnFactory) return fnFactory(); + else if (fnFactory5) + return new LexillaLexer(fnFactory5()); else return new LexerSimple(this); } diff --git a/lexlib/LexerModule.h b/lexlib/LexerModule.h index 096df5042..f22729af6 100644 --- a/lexlib/LexerModule.h +++ b/lexlib/LexerModule.h @@ -17,6 +17,7 @@ struct LexicalClass; typedef void (*LexerFunction)(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, WordList *keywordlists[], Accessor &styler); typedef ILexer *(*LexerFactoryFunction)(); +typedef ILexer5 *(*LexerFactoryFunction5)(); /** * A LexerModule is responsible for lexing and folding a particular language. @@ -30,6 +31,7 @@ protected: LexerFunction fnLexer; LexerFunction fnFolder; LexerFactoryFunction fnFactory; + LexerFactoryFunction5 fnFactory5; const char * const * wordListDescriptions; const LexicalClass *lexClasses; size_t nClasses; |
