From 215e051e588219ec41341a27bb87793732cccd88 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sat, 4 Jan 2020 13:50:52 -0500 Subject: 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. --- lexlib/LexerBase.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lexlib/LexerBase.cxx') diff --git a/lexlib/LexerBase.cxx b/lexlib/LexerBase.cxx index 655f96be6..97edc621c 100644 --- a/lexlib/LexerBase.cxx +++ b/lexlib/LexerBase.cxx @@ -44,7 +44,7 @@ void SCI_METHOD LexerBase::Release() { } int SCI_METHOD LexerBase::Version() const { - return lvMetaData; + return lvIdentity; } const char * SCI_METHOD LexerBase::PropertyNames() { @@ -69,6 +69,10 @@ Sci_Position SCI_METHOD LexerBase::PropertySet(const char *key, const char *val) } } +const char *SCI_METHOD LexerBase::PropertyGet(const char *key) { + return props.Get(key); +} + const char * SCI_METHOD LexerBase::DescribeWordListSets() { return ""; } @@ -139,3 +143,13 @@ const char * SCI_METHOD LexerBase::TagsOfStyle(int style) { const char * SCI_METHOD LexerBase::DescriptionOfStyle(int style) { return (style < NamedStyles()) ? lexClasses[style].description : ""; } + +// ILexerWithIdentity methods + +const char *SCI_METHOD LexerBase::GetName() { + return ""; +} + +int SCI_METHOD LexerBase::GetIdentifier() { + return SCLEX_AUTOMATIC; +} -- cgit v1.2.3