diff options
| -rw-r--r-- | lexlib/LexerModule.cxx | 17 | ||||
| -rw-r--r-- | lexlib/LexerModule.h | 22 | ||||
| -rw-r--r-- | src/Catalogue.cxx | 4 | ||||
| -rw-r--r-- | src/Catalogue.h | 2 | ||||
| -rw-r--r-- | src/ExternalLexer.cxx | 2 | ||||
| -rw-r--r-- | src/ExternalLexer.h | 8 | 
6 files changed, 34 insertions, 21 deletions
| diff --git a/lexlib/LexerModule.cxx b/lexlib/LexerModule.cxx index fa4a349c1..a03be30ef 100644 --- a/lexlib/LexerModule.cxx +++ b/lexlib/LexerModule.cxx @@ -34,7 +34,7 @@ LexerModule::LexerModule(int language_,  	language(language_),  	fnLexer(fnLexer_),  	fnFolder(fnFolder_), -	fnFactory(0), +	fnFactory(nullptr),  	wordListDescriptions(wordListDescriptions_),  	lexClasses(lexClasses_),  	nClasses(nClasses_), @@ -46,8 +46,8 @@ LexerModule::LexerModule(int language_,  	const char *languageName_,  	const char * const wordListDescriptions_[]) :  	language(language_), -	fnLexer(0), -	fnFolder(0), +	fnLexer(nullptr), +	fnFolder(nullptr),  	fnFactory(fnFactory_),  	wordListDescriptions(wordListDescriptions_),  	lexClasses(nullptr), @@ -55,8 +55,15 @@ LexerModule::LexerModule(int language_,  	languageName(languageName_) {  } +LexerModule::~LexerModule() { +} + +int LexerModule::GetLanguage() const {  +	return language; +} +  int LexerModule::GetNumWordLists() const { -	if (wordListDescriptions == NULL) { +	if (!wordListDescriptions) {  		return -1;  	} else {  		int numWordLists = 0; @@ -106,7 +113,7 @@ void LexerModule::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initS  		// Move back one line in case deletion wrecked current line fold state  		if (lineCurrent > 0) {  			lineCurrent--; -			Sci_Position newStartPos = styler.LineStart(lineCurrent); +			const Sci_Position newStartPos = styler.LineStart(lineCurrent);  			lengthDoc += startPos - newStartPos;  			startPos = newStartPos;  			initStyle = 0; diff --git a/lexlib/LexerModule.h b/lexlib/LexerModule.h index 050f0470d..e1d65e703 100644 --- a/lexlib/LexerModule.h +++ b/lexlib/LexerModule.h @@ -20,8 +20,9 @@ typedef ILexer4 *(*LexerFactoryFunction)();  /**   * A LexerModule is responsible for lexing and folding a particular language. - * The class maintains a list of LexerModules which can be searched to find a + * The Catalogue class maintains a list of LexerModules which can be searched to find a   * module appropriate to a particular language. + * The ExternalLexerModule subclass holds lexers loaded from DLLs or shared libraries.   */  class LexerModule {  protected: @@ -35,20 +36,21 @@ protected:  public:  	const char *languageName; -	LexerModule(int language_, +	LexerModule( +		int language_,  		LexerFunction fnLexer_, -		const char *languageName_=0, -		LexerFunction fnFolder_=0, -		const char * const wordListDescriptions_[] = NULL, +		const char *languageName_=nullptr, +		LexerFunction fnFolder_= nullptr, +		const char * const wordListDescriptions_[]=nullptr,  		const LexicalClass *lexClasses_=nullptr,  		size_t nClasses_=0); -	LexerModule(int language_, +	LexerModule( +		int language_,  		LexerFactoryFunction fnFactory_,  		const char *languageName_, -		const char * const wordListDescriptions_[] = NULL); -	virtual ~LexerModule() { -	} -	int GetLanguage() const { return language; } +		const char * const wordListDescriptions_[]=nullptr); +	virtual ~LexerModule(); +	int GetLanguage() const;  	// -1 is returned if no WordList information is available  	int GetNumWordLists() const; diff --git a/src/Catalogue.cxx b/src/Catalogue.cxx index 4da096d81..438fd2ba1 100644 --- a/src/Catalogue.cxx +++ b/src/Catalogue.cxx @@ -1,6 +1,8 @@  // Scintilla source code edit control  /** @file Catalogue.cxx - ** Colourise for particular languages. + ** Lexer infrastructure. + ** Contains a list of LexerModules which can be searched to find a module appropriate for a + ** particular language.   **/  // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>  // The License.txt file describes the conditions under which this software may be distributed. diff --git a/src/Catalogue.h b/src/Catalogue.h index b75a59fc8..d8769a896 100644 --- a/src/Catalogue.h +++ b/src/Catalogue.h @@ -1,6 +1,8 @@  // Scintilla source code edit control  /** @file Catalogue.h   ** Lexer infrastructure. + ** Contains a list of LexerModules which can be searched to find a module appropriate for a + ** particular language.   **/  // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>  // The License.txt file describes the conditions under which this software may be distributed. diff --git a/src/ExternalLexer.cxx b/src/ExternalLexer.cxx index 54bd62939..dd9a7179e 100644 --- a/src/ExternalLexer.cxx +++ b/src/ExternalLexer.cxx @@ -1,6 +1,6 @@  // Scintilla source code edit control  /** @file ExternalLexer.cxx - ** Support external lexers in DLLs. + ** Support external lexers in DLLs or shared libraries.   **/  // Copyright 2001 Simon Steele <ss@pnotepad.org>, portions copyright Neil Hodgson.  // The License.txt file describes the conditions under which this software may be distributed. diff --git a/src/ExternalLexer.h b/src/ExternalLexer.h index 1373c911d..ea7f20958 100644 --- a/src/ExternalLexer.h +++ b/src/ExternalLexer.h @@ -1,6 +1,6 @@  // Scintilla source code edit control  /** @file ExternalLexer.h - ** Support external lexers in DLLs. + ** Support external lexers in DLLs or shared libraries.   **/  // Copyright 2001 Simon Steele <ss@pnotepad.org>, portions copyright Neil Hodgson.  // The License.txt file describes the conditions under which this software may be distributed. @@ -28,9 +28,9 @@ protected:  	std::string name;  public:  	ExternalLexerModule(int language_, LexerFunction fnLexer_, -		const char *languageName_=0, LexerFunction fnFolder_=0) : -		LexerModule(language_, fnLexer_, 0, fnFolder_), -		fneFactory(0), name(languageName_){ +		const char *languageName_=nullptr, LexerFunction fnFolder_=nullptr) : +		LexerModule(language_, fnLexer_, nullptr, fnFolder_), +		fneFactory(nullptr), name(languageName_){  		languageName = name.c_str();  	}  	virtual void SetExternal(GetLexerFactoryFunction fFactory, int index); | 
