diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-07-16 19:55:15 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-07-16 19:55:15 +1000 | 
| commit | b3c9933350e5c6b9d06a72034e681cecae52dc4b (patch) | |
| tree | a733fba3b608ba75f4c55ec27cc6026697fdd3b0 /lexlib/LexerModule.cxx | |
| parent | 08b502cac1f88bc511c324ab7eb23d34c4318bd7 (diff) | |
| download | scintilla-mirror-b3c9933350e5c6b9d06a72034e681cecae52dc4b.tar.gz | |
Add constexpr, const, noexcept and make other small improvements to lexlib.
Diffstat (limited to 'lexlib/LexerModule.cxx')
| -rw-r--r-- | lexlib/LexerModule.cxx | 17 | 
1 files changed, 7 insertions, 10 deletions
| diff --git a/lexlib/LexerModule.cxx b/lexlib/LexerModule.cxx index 3d4010756..0f1498bf2 100644 --- a/lexlib/LexerModule.cxx +++ b/lexlib/LexerModule.cxx @@ -30,7 +30,7 @@ LexerModule::LexerModule(int language_,  	LexerFunction fnFolder_,  	const char *const wordListDescriptions_[],  	const LexicalClass *lexClasses_, -	size_t nClasses_) : +	size_t nClasses_) noexcept :  	language(language_),  	fnLexer(fnLexer_),  	fnFolder(fnFolder_), @@ -44,7 +44,7 @@ LexerModule::LexerModule(int language_,  LexerModule::LexerModule(int language_,  	LexerFactoryFunction fnFactory_,  	const char *languageName_, -	const char * const wordListDescriptions_[]) : +	const char * const wordListDescriptions_[]) noexcept :  	language(language_),  	fnLexer(nullptr),  	fnFolder(nullptr), @@ -55,14 +55,11 @@ LexerModule::LexerModule(int language_,  	languageName(languageName_) {  } -LexerModule::~LexerModule() { -} - -int LexerModule::GetLanguage() const {  +int LexerModule::GetLanguage() const noexcept {  	return language;  } -int LexerModule::GetNumWordLists() const { +int LexerModule::GetNumWordLists() const noexcept {  	if (!wordListDescriptions) {  		return -1;  	} else { @@ -76,7 +73,7 @@ int LexerModule::GetNumWordLists() const {  	}  } -const char *LexerModule::GetWordListDescription(int index) const { +const char *LexerModule::GetWordListDescription(int index) const noexcept {  	assert(index < GetNumWordLists());  	if (!wordListDescriptions || (index >= GetNumWordLists())) {  		return ""; @@ -85,11 +82,11 @@ const char *LexerModule::GetWordListDescription(int index) const {  	}  } -const LexicalClass *LexerModule::LexClasses() const { +const LexicalClass *LexerModule::LexClasses() const noexcept {  	return lexClasses;  } -size_t LexerModule::NamedStyles() const { +size_t LexerModule::NamedStyles() const noexcept {  	return nClasses;  } | 
