notepad-plus-plus/lexilla/lexlib/CatalogueModules.h

74 lines
1.7 KiB
C
Raw Normal View History

// Scintilla source code edit control
/** @file CatalogueModules.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.
#ifndef CATALOGUEMODULES_H
#define CATALOGUEMODULES_H
namespace Lexilla {
class CatalogueModules {
std::vector<LexerModule *> lexerCatalogue;
public:
Update Scintilla to v5.3.7 & Lexilla to v5.2.7 Update scintilla with https://www.scintilla.org/scintilla537.zip Release 5.3.7 Released 22 September 2023. For GTK on macOS, fix popup window behaviour by setting type hints. Bug #2401. For GTK, fix assertion failure on some systems when an INDIC_SQUIGGLEPIXMAP drawn for a zero-width character. For Qt, allow parent window to handle context menu events by setting as ignored. Bug #2395. For Qt, fix potential crash when using IME with large amount of text selected. For Windows, fix building with non-English environment. Bug #2400. and lexilla https://www.scintilla.org/lexilla527.zip Release 5.2.7 Released 22 September 2023. Fix building on Windows with non-English environment. Pull request #200. Bash: fix line continuation for comments and when multiple backslashes at line end. Issue #195. Bash: treat += as operator and, inside arithmetic expressions, treat ++ and -- as operators. Issue #197. Bash: improve backslash handling inside backquoted command substitution and fix $ at end of backtick expression. Issue #194. Bash: treat words that are similar to numbers but invalid wholly as identifiers. Issue #199. Bash: consistently handle '-' options at line start and after '|' as identifiers. Issue #202. Bash: handle '-' options differently in [ single ] and [[ double ]] bracket constructs. Issue #203. F#: improve speed of folding long lines. Issue #198. HTML: fix invalid entity at line end and terminate invalid entity before invalid character. Issue #192. Fix #13991, fix #14062, close #14173
2023-09-22 11:32:35 +02:00
const LexerModule *Find(int language) const noexcept {
for (const LexerModule *lm : lexerCatalogue) {
if (lm->GetLanguage() == language) {
return lm;
}
}
return nullptr;
}
const LexerModule *Find(const char *languageName) const noexcept {
if (languageName) {
for (const LexerModule *lm : lexerCatalogue) {
if (lm->languageName && (0 == strcmp(lm->languageName, languageName))) {
return lm;
}
}
}
return nullptr;
}
void AddLexerModule(LexerModule *plm) {
lexerCatalogue.push_back(plm);
}
void AddLexerModules(std::initializer_list<LexerModule *> modules) {
lexerCatalogue.insert(lexerCatalogue.end(), modules);
}
Update Scintilla to v5.3.7 & Lexilla to v5.2.7 Update scintilla with https://www.scintilla.org/scintilla537.zip Release 5.3.7 Released 22 September 2023. For GTK on macOS, fix popup window behaviour by setting type hints. Bug #2401. For GTK, fix assertion failure on some systems when an INDIC_SQUIGGLEPIXMAP drawn for a zero-width character. For Qt, allow parent window to handle context menu events by setting as ignored. Bug #2395. For Qt, fix potential crash when using IME with large amount of text selected. For Windows, fix building with non-English environment. Bug #2400. and lexilla https://www.scintilla.org/lexilla527.zip Release 5.2.7 Released 22 September 2023. Fix building on Windows with non-English environment. Pull request #200. Bash: fix line continuation for comments and when multiple backslashes at line end. Issue #195. Bash: treat += as operator and, inside arithmetic expressions, treat ++ and -- as operators. Issue #197. Bash: improve backslash handling inside backquoted command substitution and fix $ at end of backtick expression. Issue #194. Bash: treat words that are similar to numbers but invalid wholly as identifiers. Issue #199. Bash: consistently handle '-' options at line start and after '|' as identifiers. Issue #202. Bash: handle '-' options differently in [ single ] and [[ double ]] bracket constructs. Issue #203. F#: improve speed of folding long lines. Issue #198. HTML: fix invalid entity at line end and terminate invalid entity before invalid character. Issue #192. Fix #13991, fix #14062, close #14173
2023-09-22 11:32:35 +02:00
size_t Count() const noexcept {
return lexerCatalogue.size();
}
Update Scintilla to v5.3.7 & Lexilla to v5.2.7 Update scintilla with https://www.scintilla.org/scintilla537.zip Release 5.3.7 Released 22 September 2023. For GTK on macOS, fix popup window behaviour by setting type hints. Bug #2401. For GTK, fix assertion failure on some systems when an INDIC_SQUIGGLEPIXMAP drawn for a zero-width character. For Qt, allow parent window to handle context menu events by setting as ignored. Bug #2395. For Qt, fix potential crash when using IME with large amount of text selected. For Windows, fix building with non-English environment. Bug #2400. and lexilla https://www.scintilla.org/lexilla527.zip Release 5.2.7 Released 22 September 2023. Fix building on Windows with non-English environment. Pull request #200. Bash: fix line continuation for comments and when multiple backslashes at line end. Issue #195. Bash: treat += as operator and, inside arithmetic expressions, treat ++ and -- as operators. Issue #197. Bash: improve backslash handling inside backquoted command substitution and fix $ at end of backtick expression. Issue #194. Bash: treat words that are similar to numbers but invalid wholly as identifiers. Issue #199. Bash: consistently handle '-' options at line start and after '|' as identifiers. Issue #202. Bash: handle '-' options differently in [ single ] and [[ double ]] bracket constructs. Issue #203. F#: improve speed of folding long lines. Issue #198. HTML: fix invalid entity at line end and terminate invalid entity before invalid character. Issue #192. Fix #13991, fix #14062, close #14173
2023-09-22 11:32:35 +02:00
const char *Name(size_t index) const noexcept {
if (index < lexerCatalogue.size()) {
return lexerCatalogue[index]->languageName;
}
Update Scintilla to v5.3.7 & Lexilla to v5.2.7 Update scintilla with https://www.scintilla.org/scintilla537.zip Release 5.3.7 Released 22 September 2023. For GTK on macOS, fix popup window behaviour by setting type hints. Bug #2401. For GTK, fix assertion failure on some systems when an INDIC_SQUIGGLEPIXMAP drawn for a zero-width character. For Qt, allow parent window to handle context menu events by setting as ignored. Bug #2395. For Qt, fix potential crash when using IME with large amount of text selected. For Windows, fix building with non-English environment. Bug #2400. and lexilla https://www.scintilla.org/lexilla527.zip Release 5.2.7 Released 22 September 2023. Fix building on Windows with non-English environment. Pull request #200. Bash: fix line continuation for comments and when multiple backslashes at line end. Issue #195. Bash: treat += as operator and, inside arithmetic expressions, treat ++ and -- as operators. Issue #197. Bash: improve backslash handling inside backquoted command substitution and fix $ at end of backtick expression. Issue #194. Bash: treat words that are similar to numbers but invalid wholly as identifiers. Issue #199. Bash: consistently handle '-' options at line start and after '|' as identifiers. Issue #202. Bash: handle '-' options differently in [ single ] and [[ double ]] bracket constructs. Issue #203. F#: improve speed of folding long lines. Issue #198. HTML: fix invalid entity at line end and terminate invalid entity before invalid character. Issue #192. Fix #13991, fix #14062, close #14173
2023-09-22 11:32:35 +02:00
return "";
}
Update Scintilla to v5.3.7 & Lexilla to v5.2.7 Update scintilla with https://www.scintilla.org/scintilla537.zip Release 5.3.7 Released 22 September 2023. For GTK on macOS, fix popup window behaviour by setting type hints. Bug #2401. For GTK, fix assertion failure on some systems when an INDIC_SQUIGGLEPIXMAP drawn for a zero-width character. For Qt, allow parent window to handle context menu events by setting as ignored. Bug #2395. For Qt, fix potential crash when using IME with large amount of text selected. For Windows, fix building with non-English environment. Bug #2400. and lexilla https://www.scintilla.org/lexilla527.zip Release 5.2.7 Released 22 September 2023. Fix building on Windows with non-English environment. Pull request #200. Bash: fix line continuation for comments and when multiple backslashes at line end. Issue #195. Bash: treat += as operator and, inside arithmetic expressions, treat ++ and -- as operators. Issue #197. Bash: improve backslash handling inside backquoted command substitution and fix $ at end of backtick expression. Issue #194. Bash: treat words that are similar to numbers but invalid wholly as identifiers. Issue #199. Bash: consistently handle '-' options at line start and after '|' as identifiers. Issue #202. Bash: handle '-' options differently in [ single ] and [[ double ]] bracket constructs. Issue #203. F#: improve speed of folding long lines. Issue #198. HTML: fix invalid entity at line end and terminate invalid entity before invalid character. Issue #192. Fix #13991, fix #14062, close #14173
2023-09-22 11:32:35 +02:00
LexerFactoryFunction Factory(size_t index) const noexcept {
// Works for object lexers but not for function lexers
return lexerCatalogue[index]->fnFactory;
}
Update Scintilla to v5.3.7 & Lexilla to v5.2.7 Update scintilla with https://www.scintilla.org/scintilla537.zip Release 5.3.7 Released 22 September 2023. For GTK on macOS, fix popup window behaviour by setting type hints. Bug #2401. For GTK, fix assertion failure on some systems when an INDIC_SQUIGGLEPIXMAP drawn for a zero-width character. For Qt, allow parent window to handle context menu events by setting as ignored. Bug #2395. For Qt, fix potential crash when using IME with large amount of text selected. For Windows, fix building with non-English environment. Bug #2400. and lexilla https://www.scintilla.org/lexilla527.zip Release 5.2.7 Released 22 September 2023. Fix building on Windows with non-English environment. Pull request #200. Bash: fix line continuation for comments and when multiple backslashes at line end. Issue #195. Bash: treat += as operator and, inside arithmetic expressions, treat ++ and -- as operators. Issue #197. Bash: improve backslash handling inside backquoted command substitution and fix $ at end of backtick expression. Issue #194. Bash: treat words that are similar to numbers but invalid wholly as identifiers. Issue #199. Bash: consistently handle '-' options at line start and after '|' as identifiers. Issue #202. Bash: handle '-' options differently in [ single ] and [[ double ]] bracket constructs. Issue #203. F#: improve speed of folding long lines. Issue #198. HTML: fix invalid entity at line end and terminate invalid entity before invalid character. Issue #192. Fix #13991, fix #14062, close #14173
2023-09-22 11:32:35 +02:00
Scintilla::ILexer5 *Create(size_t index) const {
const LexerModule *plm = lexerCatalogue[index];
if (!plm) {
return nullptr;
}
return plm->Create();
}
};
}
#endif