aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexEDIFACT.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-12-22 22:36:51 +1100
committerNeil <nyamatongwe@gmail.com>2019-12-22 22:36:51 +1100
commiteed707bb9ad6da944af207a51e4a8d460d6c6846 (patch)
treeb504d202eea59088f3290d8c12d3307b17e88b93 /lexers/LexEDIFACT.cxx
parenta4bd72249722211f08ffa3e65c664a9ccbbc7f84 (diff)
downloadscintilla-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/LexEDIFACT.cxx')
-rw-r--r--lexers/LexEDIFACT.cxx25
1 files changed, 22 insertions, 3 deletions
diff --git a/lexers/LexEDIFACT.cxx b/lexers/LexEDIFACT.cxx
index 45f13bb3f..3623807a4 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"
@@ -29,13 +31,13 @@ public:
LexerEDIFACT();
virtual ~LexerEDIFACT() {} // virtual destructor, as we inherit from ILexer
- static ILexer4 *Factory() {
+ static ILexer5 *Factory() {
return new LexerEDIFACT;
}
int SCI_METHOD Version() const override
{
- return lvRelease4;
+ return lvRelease5;
}
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;