diff options
| author | mitchell <unknown> | 2020-01-04 13:50:52 -0500 |
|---|---|---|
| committer | mitchell <unknown> | 2020-01-04 13:50:52 -0500 |
| commit | 215e051e588219ec41341a27bb87793732cccd88 (patch) | |
| tree | bfcd76bec4252a214985c66da3d3d88c8123154a /lexers/LexEDIFACT.cxx | |
| parent | a64428dc77747caba268e25e4ec9d7d1db10eefa (diff) | |
| download | scintilla-mirror-215e051e588219ec41341a27bb87793732cccd88.tar.gz | |
Backport: Define ILexerWithIdentity with methods for retrieving name, ID, and property values.
Implement ILexerWithIdentity on object lexers.
Implement ILexerWithIdentity on LexerSimple wrapper for function lexers.
Backport of changeset 7870:6ffcbd42288c, but with a new interface compatible
with ILexer, not ILexer5.
Diffstat (limited to 'lexers/LexEDIFACT.cxx')
| -rw-r--r-- | lexers/LexEDIFACT.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lexers/LexEDIFACT.cxx b/lexers/LexEDIFACT.cxx index 9c1de5d77..efc9b5806 100644 --- a/lexers/LexEDIFACT.cxx +++ b/lexers/LexEDIFACT.cxx @@ -13,6 +13,8 @@ #include <cstring> #include <cctype> +#include <string> + #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" @@ -35,7 +37,7 @@ public: int SCI_METHOD Version() const override { - return lvOriginal; + return lvIdentity; } void SCI_METHOD Release() override { @@ -73,6 +75,21 @@ public: } return -1; } + + const char * SCI_METHOD PropertyGet(const char *key) override + { + m_lastPropertyValue = ""; + if (!strcmp(key, "fold")) + { + m_lastPropertyValue = m_bFold ? "1" : "0"; + } + if (!strcmp(key, "lexer.edifact.highlight.un.all")) // GetProperty + { + m_lastPropertyValue = m_bHighlightAllUN ? "1" : "0"; + } + return m_lastPropertyValue.c_str(); + } + const char * SCI_METHOD DescribeWordListSets() override { return NULL; @@ -105,6 +122,8 @@ protected: char m_chDecimal; char m_chRelease; char m_chSegment; + + std::string m_lastPropertyValue; }; LexerModule lmEDIFACT(SCLEX_EDIFACT, LexerEDIFACT::Factory, "edifact"); @@ -115,7 +134,7 @@ LexerModule lmEDIFACT(SCLEX_EDIFACT, LexerEDIFACT::Factory, "edifact"); /////////////////////////////////////////////////////////////////////////////// -LexerEDIFACT::LexerEDIFACT() +LexerEDIFACT::LexerEDIFACT() : DefaultLexer("edifact", SCLEX_EDIFACT) { m_bFold = false; m_bHighlightAllUN = false; |
