diff options
author | Neil <nyamatongwe@gmail.com> | 2019-12-22 22:36:51 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-12-22 22:36:51 +1100 |
commit | eed707bb9ad6da944af207a51e4a8d460d6c6846 (patch) | |
tree | b504d202eea59088f3290d8c12d3307b17e88b93 /lexers/LexCPP.cxx | |
parent | a4bd72249722211f08ffa3e65c664a9ccbbc7f84 (diff) | |
download | scintilla-mirror-eed707bb9ad6da944af207a51e4a8d460d6c6846.tar.gz |
Define ILexer5 with methods for retrieving name, ID, and property values.
Implement ILexer5 on object lexers.
Implement ILexer5 on LexerSimple wrapper for function lexers.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r-- | lexers/LexCPP.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 6d3f55684..908949aaf 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -501,7 +501,7 @@ const int sizeLexicalClasses = static_cast<int>(std::size(lexicalClasses)); } -class LexerCPP : public ILexer4 { +class LexerCPP : public ILexer5 { bool caseSensitive; CharacterSet setWord; CharacterSet setNegationOp; @@ -564,7 +564,7 @@ public: delete this; } int SCI_METHOD Version() const noexcept override { - return lvRelease4; + return lvRelease5; } const char * SCI_METHOD PropertyNames() override { return osCPP.PropertyNames(); @@ -674,10 +674,19 @@ public: return ""; } - static ILexer4 *LexerFactoryCPP() { + // ILexer5 methods + const char * SCI_METHOD GetName() override { + return caseSensitive ? "cpp" : "cppnocase"; + } + int SCI_METHOD GetIdentifier() override { + return caseSensitive ? SCLEX_CPP : SCLEX_CPPNOCASE; + } + const char * SCI_METHOD PropertyGet(const char *key) override; + + static ILexer5 *LexerFactoryCPP() { return new LexerCPP(true); } - static ILexer4 *LexerFactoryCPPInsensitive() { + static ILexer5 *LexerFactoryCPPInsensitive() { return new LexerCPP(false); } constexpr static int MaskActive(int style) noexcept { @@ -701,6 +710,10 @@ Sci_Position SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) return -1; } +const char * SCI_METHOD LexerCPP::PropertyGet(const char *key) { + return osCPP.PropertyGet(key); +} + Sci_Position SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) { WordList *wordListN = nullptr; switch (n) { |