mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #3261 from RaiKoHoff/Dev_Lexilla
Update Lexilla Lib v.5.0.1
This commit is contained in:
commit
310566d59b
1
lexilla/.gitignore
vendored
1
lexilla/.gitignore
vendored
@ -58,6 +58,7 @@ cocoa/ScintillaTest/build
|
||||
macosx/SciTest/build
|
||||
*.cppcheck
|
||||
cov-int
|
||||
*.tgz
|
||||
.vs
|
||||
meson-private
|
||||
meson-logs
|
||||
|
||||
@ -61,9 +61,18 @@ std::wstring WideStringFromUTF8(std::string_view sv) {
|
||||
|
||||
#endif
|
||||
|
||||
// Turn off deprecation checks as LexillaAccess deprecates its wrapper over
|
||||
// the deprecated LexerNameFromID. Thus use within LexillaAccess is intentional.
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#else
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
std::string directoryLoadDefault;
|
||||
std::string lastLoaded;
|
||||
std::vector<Lexilla::CreateLexerFn> fnCLs;
|
||||
std::vector<Lexilla::LexerNameFromIDFn> fnLNFIs;
|
||||
std::vector<Lexilla::GetLibraryPropertyNamesFn> fnGLPNs;
|
||||
std::vector<std::string> lexers;
|
||||
std::vector<std::string> libraryProperties;
|
||||
@ -109,6 +118,7 @@ bool Lexilla::Load(std::string_view sharedLibraryPaths) {
|
||||
lexers.clear();
|
||||
|
||||
fnCLs.clear();
|
||||
fnLNFIs.clear();
|
||||
fnGLPNs.clear();
|
||||
fnSLPs.clear();
|
||||
while (!paths.empty()) {
|
||||
@ -157,6 +167,11 @@ bool Lexilla::Load(std::string_view sharedLibraryPaths) {
|
||||
if (fnCL) {
|
||||
fnCLs.push_back(fnCL);
|
||||
}
|
||||
LexerNameFromIDFn fnLNFI = FunctionPointer<LexerNameFromIDFn>(
|
||||
FindSymbol(lexillaDL, LEXILLA_LEXERNAMEFROMID));
|
||||
if (fnLNFI) {
|
||||
fnLNFIs.push_back(fnLNFI);
|
||||
}
|
||||
GetLibraryPropertyNamesFn fnGLPN = FunctionPointer<GetLibraryPropertyNamesFn>(
|
||||
FindSymbol(lexillaDL, LEXILLA_GETLIBRARYPROPERTYNAMES));
|
||||
if (fnGLPN) {
|
||||
@ -218,6 +233,16 @@ std::vector<std::string> Lexilla::Lexers() {
|
||||
return lexers;
|
||||
}
|
||||
|
||||
std::string Lexilla::NameFromID(int identifier) {
|
||||
for (Lexilla::LexerNameFromIDFn fnLNFI : fnLNFIs) {
|
||||
const char *name = fnLNFI(identifier);
|
||||
if (name) {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::vector<std::string> Lexilla::LibraryProperties() {
|
||||
return libraryProperties;
|
||||
}
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
// Copyright 2019 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifndef LEXILLACOLLECTION_H
|
||||
#define LEXILLACOLLECTION_H
|
||||
#ifndef LEXILLAACCESS_H
|
||||
#define LEXILLAACCESS_H
|
||||
|
||||
namespace Lexilla {
|
||||
|
||||
@ -26,6 +26,7 @@ bool Load(std::string_view sharedLibraryPaths);
|
||||
Scintilla::ILexer5 *MakeLexer(std::string_view languageName);
|
||||
|
||||
std::vector<std::string> Lexers();
|
||||
[[deprecated]] std::string NameFromID(int identifier);
|
||||
std::vector<std::string> LibraryProperties();
|
||||
void SetProperty(const char *key, const char *value);
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ passedByValue
|
||||
// Suppress most lexer warnings since the lexers are maintained by others
|
||||
redundantCondition:lexilla/lexers/LexA68k.cxx
|
||||
constParameter:lexilla/lexers/LexAbaqus.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexAPDL.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexAU3.cxx
|
||||
shadowVariable:lexilla/lexers/LexAU3.cxx
|
||||
constParameter:lexilla/lexers/LexBaan.cxx
|
||||
@ -31,6 +32,7 @@ constParameter:lexilla/lexers/LexBash.cxx
|
||||
uninitMemberVar:lexilla/lexers/LexBash.cxx
|
||||
variableScope:lexilla/lexers/LexBash.cxx
|
||||
variableScope:lexilla/lexers/LexBatch.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexBibTeX.cxx
|
||||
variableScope:lexilla/lexers/LexCmake.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexCmake.cxx
|
||||
constParameter:lexilla/lexers/LexCLW.cxx
|
||||
@ -40,6 +42,7 @@ variableScope:lexilla/lexers/LexCSS.cxx
|
||||
variableScope:lexilla/lexers/LexDataflex.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexECL.cxx
|
||||
variableScope:lexilla/lexers/LexErlang.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexErlang.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexEScript.cxx
|
||||
constParameter:lexilla/lexers/LexFortran.cxx
|
||||
redundantCondition:lexilla/lexers/LexFSharp.cxx
|
||||
@ -66,10 +69,10 @@ variableScope:lexilla/lexers/LexNimrod.cxx
|
||||
variableScope:lexilla/lexers/LexNsis.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexNsis.cxx
|
||||
variableScope:lexilla/lexers/LexOpal.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexOpal.cxx
|
||||
constParameter:lexilla/lexers/LexOScript.cxx
|
||||
variableScope:lexilla/lexers/LexPB.cxx
|
||||
constParameter:lexilla/lexers/LexPerl.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexPerl.cxx
|
||||
constParameter:lexilla/lexers/LexPython.cxx
|
||||
shadowVariable:lexilla/lexers/LexPowerPro.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexPowerPro.cxx
|
||||
@ -100,6 +103,7 @@ unreadVariable:lexilla/lexers/LexVHDL.cxx
|
||||
variableScope:lexilla/lexers/LexVHDL.cxx
|
||||
unreadVariable:lexilla/lexers/LexVisualProlog.cxx
|
||||
constParameter:lexilla/lexers/LexYAML.cxx
|
||||
knownConditionTrueFalse:lexilla/lexers/LexYAML.cxx
|
||||
|
||||
// These are due to Accessor::IndentAmount not declaring the callback as taking a const.
|
||||
// Changing this could cause problems for downstream projects.
|
||||
@ -142,6 +146,3 @@ redundantAssignment:lexilla/lexers/LexCPP.cxx
|
||||
|
||||
// Suppress everything in catch.hpp as won't be changing
|
||||
*:lexilla/test/unit/catch.hpp
|
||||
// For now, suppress all test source files as, since Catch 2, cppcheck shows many warnings showing
|
||||
// it doesn't understand the REQUIRE macro
|
||||
*:lexilla/test/unit/*.cxx
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
|
||||
<meta name="Description"
|
||||
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
|
||||
<meta name="Date.Modified" content="20210305" />
|
||||
<meta name="Date.Modified" content="20210405" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<style type="text/css">
|
||||
.logo {
|
||||
@ -62,7 +62,7 @@
|
||||
</td>
|
||||
<td width="40%" align="right">
|
||||
<font color="#FFCC99" size="3">Release version 5.0.0<br />
|
||||
Site last modified March 5 2021</font>
|
||||
Site last modified April 5 2021</font>
|
||||
</td>
|
||||
<td width="20%">
|
||||
|
||||
@ -77,6 +77,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
<ul id="versionlist">
|
||||
<li>Version 5.0.1 adds a LexerNameFromID function to the Lexilla protocol to ease migrating applications.
|
||||
The cpp and errorlist lexers were improved.</li>
|
||||
<li>Version 5.0.0 is an unstable testing release.</li>
|
||||
</ul>
|
||||
<ul id="menu">
|
||||
@ -129,6 +131,9 @@ if (!IsRemote()) { //if NOT remote...
|
||||
<a href="https://github.com/ScintillaOrg/lexilla">Lexilla project page</a>.<br />
|
||||
git clone https://github.com/ScintillaOrg/lexilla
|
||||
</p>
|
||||
<p>Current repository status:
|
||||
<a href="https://travis-ci.org/github/ScintillaOrg/lexilla">
|
||||
<img src="https://travis-ci.org/ScintillaOrg/lexilla.svg?branch=master" /></a></p>
|
||||
<p>
|
||||
<a href="https://www.scintilla.org/ScintillaRelated.html">Related sites.</a>
|
||||
</p>
|
||||
|
||||
@ -94,6 +94,7 @@
|
||||
<code>void <span class="name">GetLexerName</span>(unsigned int index, char *name, int buflength)</code><br />
|
||||
<code>LexerFactoryFunction <span class="name">GetLexerFactory</span>(unsigned int index)</code><br />
|
||||
<code>ILexer5 *<span class="name">CreateLexer</span>(const char *name)</code><br />
|
||||
<code>const char *<span class="name">LexerNameFromID</span>(int identifier)</code><br />
|
||||
<code>void <span class="name">SetLibraryProperty</span>(const char *key, const char *value)</code><br />
|
||||
<code>const char *<span class="name">GetLibraryPropertyNames</span>()</code>
|
||||
</p>
|
||||
@ -117,6 +118,12 @@
|
||||
set as the current lexer in Scintilla by calling
|
||||
<a class="seealso" href="ScintillaDoc.html#SCI_SETILEXER">SCI_SETILEXER</a>.</p>
|
||||
|
||||
<p><span class="name">LexerNameFromID</span> is an optional function that returns the name for a lexer identifier.
|
||||
<code>LexerNameFromID(SCLEX_CPP) -> "cpp"</code>.
|
||||
This is a temporary affordance to make it easier to convert applications to using Lexilla.
|
||||
Applications should move to using lexer names instead of IDs.
|
||||
This function is deprecated, showing warnings with some compilers, and will be removed in a future version of Lexilla.</p>
|
||||
|
||||
<p><span class="name">SetLibraryProperty</span> and <span class="name">GetLibraryPropertyNames</span>
|
||||
are optional functions that can be
|
||||
defined if a library requires initialisation before calling other methods.
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<font size="4"> <a href="https://www.scintilla.org/lexilla500.zip">
|
||||
<font size="4"> <a href="https://www.scintilla.org/lexilla501.zip">
|
||||
Windows</a>
|
||||
<a href="https://www.scintilla.org/lexilla500.tgz">
|
||||
<a href="https://www.scintilla.org/lexilla501.tgz">
|
||||
GTK/Linux</a>
|
||||
</font>
|
||||
</td>
|
||||
@ -50,8 +50,8 @@
|
||||
The source code package contains all of the source code for Lexilla but no binary
|
||||
executable code and is available in
|
||||
<ul>
|
||||
<li><a href="https://www.scintilla.org/lexilla500.zip">zip format</a> (1.0M) commonly used on Windows</li>
|
||||
<li><a href="https://www.scintilla.org/lexilla500.tgz">tgz format</a> (0.8M) commonly used on Linux and compatible operating systems</li>
|
||||
<li><a href="https://www.scintilla.org/lexilla501.zip">zip format</a> (1.0M) commonly used on Windows</li>
|
||||
<li><a href="https://www.scintilla.org/lexilla501.tgz">tgz format</a> (0.8M) commonly used on Linux and compatible operating systems</li>
|
||||
</ul>
|
||||
Instructions for building on both Windows and Linux are included in the readme file.
|
||||
<h4>
|
||||
|
||||
@ -565,6 +565,26 @@
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Releases</h2>
|
||||
<h3>
|
||||
<a href="https://www.scintilla.org/lexilla501.zip">Release 5.0.1</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>
|
||||
Released 5 March 2021.
|
||||
</li>
|
||||
<li>
|
||||
Add LexerNameFromID function to Lexilla protocol as optional and temporary to
|
||||
help applications migrate to Lexilla.
|
||||
It is marked deprecated and will be removed in a future release.
|
||||
</li>
|
||||
<li>
|
||||
The cpp lexer supports XML styled comment doc keywords.
|
||||
<a href="https://github.com/ScintillaOrg/lexilla/pull/2">Pull request #2</a>.
|
||||
</li>
|
||||
<li>
|
||||
The errorlist lexer detects NMAKE fatal errors and Microsoft linker errors as SCE_ERR_MS.
|
||||
</li>
|
||||
</ul>
|
||||
<h3>
|
||||
<a href="https://www.scintilla.org/lexilla500.zip">Release 5.0.0</a>
|
||||
</h3>
|
||||
|
||||
@ -12,6 +12,11 @@
|
||||
Win32
|
||||
gcc CheckLexilla.c -I ../../include -o CheckLexilla
|
||||
CheckLexilla
|
||||
CheckLexilla ../SimpleLexer/SimpleLexer.dll
|
||||
|
||||
Win32 Visual C++
|
||||
cl CheckLexilla.c -I ../../include -Fe: CheckLexilla
|
||||
CheckLexilla
|
||||
CheckLexilla ../SimpleLexer/SimpleLexer.dll
|
||||
|
||||
macOS
|
||||
@ -24,6 +29,12 @@ gcc CheckLexilla.c -I ../../include -ldl -o CheckLexilla
|
||||
./CheckLexilla
|
||||
./CheckLexilla ../SimpleLexer/SimpleLexer.so
|
||||
|
||||
While principally meant for compilation as C to act as an example of using Lexilla
|
||||
from C it can also be built as C++.
|
||||
|
||||
Warnings are intentionally shown for the deprecated typedef LexerNameFromIDFn when compiled with
|
||||
GCC or Clang or as C++.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -34,8 +45,16 @@ gcc CheckLexilla.c -I ../../include -ldl -o CheckLexilla
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "ILexer.h"
|
||||
#endif
|
||||
|
||||
#include "Lexilla.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
using namespace Lexilla;
|
||||
#endif
|
||||
|
||||
#if _WIN32
|
||||
typedef FARPROC Function;
|
||||
typedef HMODULE Module;
|
||||
@ -86,6 +105,18 @@ int main(int argc, char *argv[]) {
|
||||
ILexer5 *lexerCpp = lexerCreate("cpp");
|
||||
printf("Created cpp lexer -> %p.\n", lexerCpp);
|
||||
|
||||
LexerNameFromIDFn lexerNameFromID = (LexerNameFromIDFn)FindSymbol(lexillaLibrary, LEXILLA_LEXERNAMEFROMID);
|
||||
if (lexerNameFromID) {
|
||||
const char *lexerNameCpp = lexerNameFromID(3); // SCLEX_CPP=3
|
||||
if (lexerNameCpp) {
|
||||
printf("Lexer name 3 -> %s.\n", lexerNameCpp);
|
||||
} else {
|
||||
printf("Lexer name 3 not available.\n");
|
||||
}
|
||||
} else {
|
||||
printf("Lexer name from ID not supported.\n");
|
||||
}
|
||||
|
||||
GetLibraryPropertyNamesFn libraryProperties = (GetLibraryPropertyNamesFn)FindSymbol(lexillaLibrary, LEXILLA_GETLIBRARYPROPERTYNAMES);
|
||||
if (libraryProperties) {
|
||||
const char *names = libraryProperties();
|
||||
|
||||
@ -6,6 +6,9 @@
|
||||
// Copyright 2020 by Neil Hodgson <neilh@scintilla.org>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
#ifndef LEXILLA_H
|
||||
#define LEXILLA_H
|
||||
|
||||
// Define the default Lexilla shared library name for each platform
|
||||
#if _WIN32
|
||||
#define LEXILLA_LIB "lexilla"
|
||||
@ -26,6 +29,18 @@
|
||||
#define LEXILLA_CALL
|
||||
#endif
|
||||
|
||||
#if defined(__OBJC2__)
|
||||
// Objective C(++) treats '[' as a message expression.
|
||||
#define DEPRECATE_DEFINITION
|
||||
#elif defined(__cplusplus)
|
||||
#define DEPRECATE_DEFINITION [[deprecated]]
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define DEPRECATE_DEFINITION __attribute__((deprecated))
|
||||
#else
|
||||
// MSVC __declspec(deprecated) has different positioning rules to GCC so define to nothing
|
||||
#define DEPRECATE_DEFINITION
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Must have already included ILexer.h to have Scintilla::ILexer5 defined.
|
||||
using Scintilla::ILexer5;
|
||||
@ -43,6 +58,7 @@ typedef int (LEXILLA_CALL *GetLexerCountFn)();
|
||||
typedef void (LEXILLA_CALL *GetLexerNameFn)(unsigned int Index, char *name, int buflength);
|
||||
typedef LexerFactoryFunction(LEXILLA_CALL *GetLexerFactoryFn)(unsigned int Index);
|
||||
typedef ILexer5*(LEXILLA_CALL *CreateLexerFn)(const char *name);
|
||||
DEPRECATE_DEFINITION typedef const char *(LEXILLA_CALL *LexerNameFromIDFn)(int identifier);
|
||||
typedef const char *(LEXILLA_CALL *GetLibraryPropertyNamesFn)();
|
||||
typedef void(LEXILLA_CALL *SetLibraryPropertyFn)(const char *key, const char *value);
|
||||
|
||||
@ -54,6 +70,7 @@ typedef void(LEXILLA_CALL *SetLibraryPropertyFn)(const char *key, const char *va
|
||||
#define LEXILLA_GETLEXERNAME "GetLexerName"
|
||||
#define LEXILLA_GETLEXERFACTORY "GetLexerFactory"
|
||||
#define LEXILLA_CREATELEXER "CreateLexer"
|
||||
#define LEXILLA_LEXERNAMEFROMID "LexerNameFromID"
|
||||
#define LEXILLA_GETLIBRARYPROPERTYNAMES "GetLibraryPropertyNames"
|
||||
#define LEXILLA_SETLIBRARYPROPERTY "SetLibraryProperty"
|
||||
|
||||
@ -67,9 +84,12 @@ ILexer5 * LEXILLA_CALL CreateLexer(const char *name);
|
||||
int LEXILLA_CALL GetLexerCount();
|
||||
void LEXILLA_CALL GetLexerName(unsigned int index, char *name, int buflength);
|
||||
LexerFactoryFunction LEXILLA_CALL GetLexerFactory(unsigned int index);
|
||||
DEPRECATE_DEFINITION const char *LEXILLA_CALL LexerNameFromID(int identifier);
|
||||
const char * LEXILLA_CALL GetLibraryPropertyNames();
|
||||
void LEXILLA_CALL SetLibraryProperty(const char *key, const char *value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -1030,6 +1030,10 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
|
||||
styleBeforeDCKeyword = SCE_C_COMMENTDOC;
|
||||
sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet);
|
||||
}
|
||||
} else if ((sc.ch == '<' && sc.chNext != '/')
|
||||
|| (sc.ch == '/' && sc.chPrev == '<')) { // XML comment style
|
||||
styleBeforeDCKeyword = SCE_C_COMMENTDOC;
|
||||
sc.ForwardSetState(SCE_C_COMMENTDOCKEYWORD | activitySet);
|
||||
}
|
||||
break;
|
||||
case SCE_C_COMMENTLINE:
|
||||
@ -1049,6 +1053,10 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
|
||||
styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC;
|
||||
sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet);
|
||||
}
|
||||
} else if ((sc.ch == '<' && sc.chNext != '/')
|
||||
|| (sc.ch == '/' && sc.chPrev == '<')) { // XML comment style
|
||||
styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC;
|
||||
sc.ForwardSetState(SCE_C_COMMENTDOCKEYWORD | activitySet);
|
||||
}
|
||||
break;
|
||||
case SCE_C_COMMENTDOCKEYWORD:
|
||||
@ -1069,7 +1077,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
|
||||
}
|
||||
if (!(IsASpace(sc.ch) || (sc.ch == 0))) {
|
||||
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet);
|
||||
} else if (!keywords3.InList(s + 1)) {
|
||||
} else if (!keywords3.InList(s + 1) && !keywords3.InList(s)) {
|
||||
int subStyleCDKW = classifierDocKeyWords.ValueFor(s+1);
|
||||
if (subStyleCDKW >= 0) {
|
||||
sc.ChangeState(subStyleCDKW|activitySet);
|
||||
@ -1079,6 +1087,23 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
|
||||
}
|
||||
sc.SetState(styleBeforeDCKeyword|activitySet);
|
||||
seenDocKeyBrace = false;
|
||||
} else if (sc.ch == '>') {
|
||||
char s[100];
|
||||
if (caseSensitive) {
|
||||
sc.GetCurrent(s, sizeof(s));
|
||||
} else {
|
||||
sc.GetCurrentLowered(s, sizeof(s));
|
||||
}
|
||||
if (!keywords3.InList(s)) {
|
||||
int subStyleCDKW = classifierDocKeyWords.ValueFor(s + 1);
|
||||
if (subStyleCDKW >= 0) {
|
||||
sc.ChangeState(subStyleCDKW | activitySet);
|
||||
} else {
|
||||
sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR | activitySet);
|
||||
}
|
||||
}
|
||||
sc.SetState(styleBeforeDCKeyword | activitySet);
|
||||
seenDocKeyBrace = false;
|
||||
}
|
||||
break;
|
||||
case SCE_C_STRING:
|
||||
|
||||
@ -187,7 +187,7 @@ namespace Scintilla {
|
||||
else if (ch <= 32 && len >= 3 && len < 16 && AnyOf(sc.ch, 'T', 'F', 'N', 'X')) {
|
||||
char s[8];
|
||||
sc.GetCurrent(s, sizeof(s));
|
||||
marker = StrEqualsAny(s, "TODO", "FIXME", "NOTE", "XXX", "TBD")
|
||||
marker = StrEqualsAny(s, "BUG", "FIXME", "HACK", "NOTE", "TBD", "TODO", "XXX")
|
||||
|| StrStartsWith(s, "NOLINT"); // clang-tidy: NOLINT, NOLINTNEXTLINE
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +39,10 @@ public:
|
||||
lexerCatalogue.push_back(plm);
|
||||
}
|
||||
|
||||
void AddLexerModules(std::initializer_list<LexerModule *> modules) {
|
||||
lexerCatalogue.insert(lexerCatalogue.end(), modules);
|
||||
}
|
||||
|
||||
unsigned int Count() const noexcept {
|
||||
return static_cast<unsigned int>(lexerCatalogue.size());
|
||||
}
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <initializer_list>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <functional>
|
||||
|
||||
@ -41,10 +41,12 @@ sys.path.append(str(thisPath.parent.parent.parent / "scintilla" / "scripts"))
|
||||
|
||||
import FileGenerator
|
||||
|
||||
neutralEncoding = "latin_1"
|
||||
|
||||
def FindModules(lexFile):
|
||||
modules = []
|
||||
partLine = ""
|
||||
with lexFile.open() as f:
|
||||
with lexFile.open(encoding=neutralEncoding) as f:
|
||||
for l in f.readlines():
|
||||
l = l.rstrip()
|
||||
if partLine or l.startswith("LexerModule"):
|
||||
@ -102,7 +104,7 @@ knownIrregularProperties = [
|
||||
|
||||
def FindProperties(lexFile):
|
||||
properties = {}
|
||||
with open(lexFile) as f:
|
||||
with open(lexFile, encoding=neutralEncoding) as f:
|
||||
for l in f.readlines():
|
||||
if ("GetProperty" in l or "DefineProperty" in l) and "\"" in l:
|
||||
l = l.strip()
|
||||
@ -118,7 +120,7 @@ def FindProperties(lexFile):
|
||||
|
||||
def FindPropertyDocumentation(lexFile):
|
||||
documents = {}
|
||||
with lexFile.open() as f:
|
||||
with lexFile.open(encoding=neutralEncoding) as f:
|
||||
name = ""
|
||||
for l in f.readlines():
|
||||
l = l.strip()
|
||||
@ -214,6 +216,8 @@ class LexillaData:
|
||||
|
||||
# Find all the lexer source code files
|
||||
lexFilePaths = list((scintillaRoot / "lexers").glob("Lex*.cxx"))
|
||||
lexFilePathsEx = list((scintillaRoot / "lexers_x").glob("Lex*.cxx"))
|
||||
lexFilePaths.extend(lexFilePathsEx)
|
||||
SortListInsensitive(lexFilePaths)
|
||||
self.lexFiles = [f.stem for f in lexFilePaths]
|
||||
self.lexerModules = []
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Scintilla source code edit control
|
||||
// Lexilla lexer library
|
||||
/** @file Lexilla.cxx
|
||||
** Lexer infrastructure.
|
||||
** Provides entry points to shared library.
|
||||
@ -9,6 +9,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#include <vector>
|
||||
#include <initializer_list>
|
||||
|
||||
#if _WIN32
|
||||
#define EXPORT_FUNCTION __declspec(dllexport)
|
||||
@ -27,6 +28,7 @@ using namespace Scintilla;
|
||||
|
||||
//++Autogenerated -- run lexilla/scripts/LexillaGen.py to regenerate
|
||||
//**\(extern LexerModule \*;\n\)
|
||||
extern LexerModule lmAHKL;
|
||||
extern LexerModule lmAs;
|
||||
extern LexerModule lmAsm;
|
||||
extern LexerModule lmAU3;
|
||||
@ -39,10 +41,14 @@ extern LexerModule lmConf;
|
||||
extern LexerModule lmCPP;
|
||||
extern LexerModule lmCPPNoCase;
|
||||
extern LexerModule lmCss;
|
||||
extern LexerModule lmCSV;
|
||||
extern LexerModule lmD;
|
||||
extern LexerModule lmDart;
|
||||
extern LexerModule lmDiff;
|
||||
extern LexerModule lmHTML;
|
||||
extern LexerModule lmInno;
|
||||
extern LexerModule lmJSON;
|
||||
extern LexerModule lmKotlin;
|
||||
extern LexerModule lmLatex;
|
||||
extern LexerModule lmLua;
|
||||
extern LexerModule lmMake;
|
||||
@ -64,6 +70,7 @@ extern LexerModule lmRuby;
|
||||
extern LexerModule lmRust;
|
||||
extern LexerModule lmSQL;
|
||||
extern LexerModule lmTCL;
|
||||
extern LexerModule lmTOML;
|
||||
extern LexerModule lmVB;
|
||||
extern LexerModule lmVBScript;
|
||||
extern LexerModule lmVHDL;
|
||||
@ -72,16 +79,6 @@ extern LexerModule lmYAML;
|
||||
|
||||
//--Autogenerated -- end of automatically generated section
|
||||
|
||||
// --- custom lexers ---
|
||||
|
||||
extern LexerModule lmAHKL;
|
||||
extern LexerModule lmCSV;
|
||||
extern LexerModule lmDart;
|
||||
extern LexerModule lmJSON;
|
||||
extern LexerModule lmKotlin;
|
||||
extern LexerModule lmTOML;
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
CatalogueModules catalogueLexilla;
|
||||
@ -92,65 +89,64 @@ void AddEachLexer() {
|
||||
return;
|
||||
}
|
||||
|
||||
//++Autogenerated -- run scripts/LexGen.py to regenerate
|
||||
//**\(\tcatalogueLexilla.AddLexerModule(&\*);\n\)
|
||||
catalogueLexilla.AddLexerModule(&lmAs);
|
||||
catalogueLexilla.AddLexerModule(&lmAsm);
|
||||
catalogueLexilla.AddLexerModule(&lmAU3);
|
||||
catalogueLexilla.AddLexerModule(&lmAVS);
|
||||
catalogueLexilla.AddLexerModule(&lmBash);
|
||||
catalogueLexilla.AddLexerModule(&lmBatch);
|
||||
catalogueLexilla.AddLexerModule(&lmCmake);
|
||||
catalogueLexilla.AddLexerModule(&lmCoffeeScript);
|
||||
catalogueLexilla.AddLexerModule(&lmConf);
|
||||
catalogueLexilla.AddLexerModule(&lmCPP);
|
||||
catalogueLexilla.AddLexerModule(&lmCPPNoCase);
|
||||
catalogueLexilla.AddLexerModule(&lmCss);
|
||||
catalogueLexilla.AddLexerModule(&lmD);
|
||||
catalogueLexilla.AddLexerModule(&lmDiff);
|
||||
catalogueLexilla.AddLexerModule(&lmHTML);
|
||||
catalogueLexilla.AddLexerModule(&lmInno);
|
||||
catalogueLexilla.AddLexerModule(&lmLatex);
|
||||
catalogueLexilla.AddLexerModule(&lmLua);
|
||||
catalogueLexilla.AddLexerModule(&lmMake);
|
||||
catalogueLexilla.AddLexerModule(&lmMarkdown);
|
||||
catalogueLexilla.AddLexerModule(&lmMatlab);
|
||||
catalogueLexilla.AddLexerModule(&lmNim);
|
||||
catalogueLexilla.AddLexerModule(&lmNsis);
|
||||
catalogueLexilla.AddLexerModule(&lmNull);
|
||||
catalogueLexilla.AddLexerModule(&lmOctave);
|
||||
catalogueLexilla.AddLexerModule(&lmPascal);
|
||||
catalogueLexilla.AddLexerModule(&lmPerl);
|
||||
catalogueLexilla.AddLexerModule(&lmPHPSCRIPT);
|
||||
catalogueLexilla.AddLexerModule(&lmPowerShell);
|
||||
catalogueLexilla.AddLexerModule(&lmProps);
|
||||
catalogueLexilla.AddLexerModule(&lmPython);
|
||||
catalogueLexilla.AddLexerModule(&lmR);
|
||||
catalogueLexilla.AddLexerModule(&lmRegistry);
|
||||
catalogueLexilla.AddLexerModule(&lmRuby);
|
||||
catalogueLexilla.AddLexerModule(&lmRust);
|
||||
catalogueLexilla.AddLexerModule(&lmSQL);
|
||||
catalogueLexilla.AddLexerModule(&lmTCL);
|
||||
catalogueLexilla.AddLexerModule(&lmVB);
|
||||
catalogueLexilla.AddLexerModule(&lmVBScript);
|
||||
catalogueLexilla.AddLexerModule(&lmVHDL);
|
||||
catalogueLexilla.AddLexerModule(&lmXML);
|
||||
catalogueLexilla.AddLexerModule(&lmYAML);
|
||||
catalogueLexilla.AddLexerModules({
|
||||
//++Autogenerated -- run scripts/LexillaGen.py to regenerate
|
||||
//**\(\t\t&\*,\n\)
|
||||
&lmAHKL,
|
||||
&lmAs,
|
||||
&lmAsm,
|
||||
&lmAU3,
|
||||
&lmAVS,
|
||||
&lmBash,
|
||||
&lmBatch,
|
||||
&lmCmake,
|
||||
&lmCoffeeScript,
|
||||
&lmConf,
|
||||
&lmCPP,
|
||||
&lmCPPNoCase,
|
||||
&lmCss,
|
||||
&lmCSV,
|
||||
&lmD,
|
||||
&lmDart,
|
||||
&lmDiff,
|
||||
&lmHTML,
|
||||
&lmInno,
|
||||
&lmJSON,
|
||||
&lmKotlin,
|
||||
&lmLatex,
|
||||
&lmLua,
|
||||
&lmMake,
|
||||
&lmMarkdown,
|
||||
&lmMatlab,
|
||||
&lmNim,
|
||||
&lmNsis,
|
||||
&lmNull,
|
||||
&lmOctave,
|
||||
&lmPascal,
|
||||
&lmPerl,
|
||||
&lmPHPSCRIPT,
|
||||
&lmPowerShell,
|
||||
&lmProps,
|
||||
&lmPython,
|
||||
&lmR,
|
||||
&lmRegistry,
|
||||
&lmRuby,
|
||||
&lmRust,
|
||||
&lmSQL,
|
||||
&lmTCL,
|
||||
&lmTOML,
|
||||
&lmVB,
|
||||
&lmVBScript,
|
||||
&lmVHDL,
|
||||
&lmXML,
|
||||
&lmYAML,
|
||||
|
||||
//--Autogenerated -- end of automatically generated section
|
||||
});
|
||||
|
||||
// --- custom lexers ---
|
||||
} // AddEachLexer()
|
||||
|
||||
catalogueLexilla.AddLexerModule(&lmAHKL);
|
||||
catalogueLexilla.AddLexerModule(&lmCSV);
|
||||
catalogueLexilla.AddLexerModule(&lmDart);
|
||||
catalogueLexilla.AddLexerModule(&lmJSON);
|
||||
catalogueLexilla.AddLexerModule(&lmKotlin);
|
||||
catalogueLexilla.AddLexerModule(&lmTOML);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} // namspace
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -184,6 +180,15 @@ EXPORT_FUNCTION ILexer5 * CALLING_CONVENTION CreateLexer(const char *name) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
EXPORT_FUNCTION const char * CALLING_CONVENTION LexerNameFromID(int identifier) {
|
||||
const LexerModule *pModule = catalogueLexilla.Find(identifier);
|
||||
if (pModule) {
|
||||
return pModule->languageName;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
EXPORT_FUNCTION const char * CALLING_CONVENTION GetLibraryPropertyNames() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>5.0.0</string>
|
||||
<string>5.0.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
@ -152,6 +152,12 @@
|
||||
28BA73AD24E34DBC00272C2D /* Lexilla.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BA73AB24E34DBC00272C2D /* Lexilla.h */; };
|
||||
28BA73AE24E34DBC00272C2D /* Lexilla.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28BA73AC24E34DBC00272C2D /* Lexilla.cxx */; };
|
||||
B32D4A2A9CEC222A5140E99F /* LexFSharp.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F8E54626B22BD9493090F40B /* LexFSharp.cxx */; };
|
||||
89B84793A356A0991EBED5C4 /* LexAHKL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = C2DB4BECACB551CD43680FD8 /* LexAHKL.cxx */; };
|
||||
D47A4385B56AE95213274BCA /* LexCSV.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1432403A89A54012430D7B45 /* LexCSV.cxx */; };
|
||||
898147D7A30DC7659F81C329 /* LexDart.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1A2147D8A5DBF9D618B655B4 /* LexDart.cxx */; };
|
||||
78C242448D1B0F2D11D9507A /* LexerUtils.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F5D44C579E3ED5111F8ECDCF /* LexerUtils.cxx */; };
|
||||
B86F4DCE947423481A4C76FF /* LexKotlin.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 0F7045D4BBEEBB8940B2B183 /* LexKotlin.cxx */; };
|
||||
216B4BF89D484F772E537525 /* LexTOML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 5D8746C88D5D86D37A59BAE5 /* LexTOML.cxx */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -302,6 +308,12 @@
|
||||
28BA73AC24E34DBC00272C2D /* Lexilla.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Lexilla.cxx; path = ../Lexilla.cxx; sourceTree = "<group>"; };
|
||||
28BA73B024E3510900272C2D /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F8E54626B22BD9493090F40B /* LexFSharp.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexFSharp.cxx; path = ../../lexers/LexFSharp.cxx; sourceTree = SOURCE_ROOT; };
|
||||
C2DB4BECACB551CD43680FD8 /* LexAHKL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAHKL.cxx; path = ../../lexers/LexAHKL.cxx; sourceTree = SOURCE_ROOT; };
|
||||
1432403A89A54012430D7B45 /* LexCSV.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCSV.cxx; path = ../../lexers/LexCSV.cxx; sourceTree = SOURCE_ROOT; };
|
||||
1A2147D8A5DBF9D618B655B4 /* LexDart.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDart.cxx; path = ../../lexers/LexDart.cxx; sourceTree = SOURCE_ROOT; };
|
||||
F5D44C579E3ED5111F8ECDCF /* LexerUtils.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerUtils.cxx; path = ../../lexers/LexerUtils.cxx; sourceTree = SOURCE_ROOT; };
|
||||
0F7045D4BBEEBB8940B2B183 /* LexKotlin.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexKotlin.cxx; path = ../../lexers/LexKotlin.cxx; sourceTree = SOURCE_ROOT; };
|
||||
5D8746C88D5D86D37A59BAE5 /* LexTOML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTOML.cxx; path = ../../lexers/LexTOML.cxx; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -349,6 +361,7 @@
|
||||
28BA730624E34D9400272C2D /* LexA68k.cxx */,
|
||||
28BA72EE24E34D9300272C2D /* LexAbaqus.cxx */,
|
||||
28BA730024E34D9400272C2D /* LexAda.cxx */,
|
||||
C2DB4BECACB551CD43680FD8 /* LexAHKL.cxx */,
|
||||
28BA72DF24E34D9200272C2D /* LexAPDL.cxx */,
|
||||
28BA72FF24E34D9400272C2D /* LexAsm.cxx */,
|
||||
28BA72DB24E34D9200272C2D /* LexAsn1.cxx */,
|
||||
@ -373,7 +386,9 @@
|
||||
28BA730124E34D9400272C2D /* LexCrontab.cxx */,
|
||||
28BA731524E34D9500272C2D /* LexCsound.cxx */,
|
||||
28BA732924E34D9600272C2D /* LexCSS.cxx */,
|
||||
1432403A89A54012430D7B45 /* LexCSV.cxx */,
|
||||
28BA72E024E34D9200272C2D /* LexD.cxx */,
|
||||
1A2147D8A5DBF9D618B655B4 /* LexDart.cxx */,
|
||||
28BA732C24E34D9600272C2D /* LexDataflex.cxx */,
|
||||
28BA72DD24E34D9200272C2D /* LexDiff.cxx */,
|
||||
28BA732024E34D9600272C2D /* LexDMAP.cxx */,
|
||||
@ -383,6 +398,7 @@
|
||||
28BA72D924E34D9200272C2D /* LexEiffel.cxx */,
|
||||
28BA72E824E34D9200272C2D /* LexErlang.cxx */,
|
||||
28BA72EB24E34D9300272C2D /* LexErrorList.cxx */,
|
||||
F5D44C579E3ED5111F8ECDCF /* LexerUtils.cxx */,
|
||||
28BA72F624E34D9300272C2D /* LexEScript.cxx */,
|
||||
28BA72EC24E34D9300272C2D /* LexFlagship.cxx */,
|
||||
28BA72CB24E34D9100272C2D /* LexForth.cxx */,
|
||||
@ -398,6 +414,7 @@
|
||||
28BA730524E34D9400272C2D /* LexInno.cxx */,
|
||||
28BA733024E34D9600272C2D /* LexJSON.cxx */,
|
||||
28BA731124E34D9500272C2D /* LexKix.cxx */,
|
||||
0F7045D4BBEEBB8940B2B183 /* LexKotlin.cxx */,
|
||||
28BA72F824E34D9300272C2D /* LexKVIrc.cxx */,
|
||||
28BA72ED24E34D9300272C2D /* LexLaTeX.cxx */,
|
||||
28BA72E424E34D9200272C2D /* LexLisp.cxx */,
|
||||
@ -454,6 +471,7 @@
|
||||
28BA72C924E34D9100272C2D /* LexTCL.cxx */,
|
||||
28BA730324E34D9400272C2D /* LexTCMD.cxx */,
|
||||
28BA730824E34D9400272C2D /* LexTeX.cxx */,
|
||||
5D8746C88D5D86D37A59BAE5 /* LexTOML.cxx */,
|
||||
28BA730F24E34D9500272C2D /* LexTxt2tags.cxx */,
|
||||
28BA731F24E34D9600272C2D /* LexVB.cxx */,
|
||||
28BA731A24E34D9500272C2D /* LexVerilog.cxx */,
|
||||
@ -712,6 +730,12 @@
|
||||
28BA72B424E34D5B00272C2D /* PropSetSimple.cxx in Sources */,
|
||||
28BA737C24E34D9700272C2D /* LexX12.cxx in Sources */,
|
||||
B32D4A2A9CEC222A5140E99F /* LexFSharp.cxx in Sources */,
|
||||
89B84793A356A0991EBED5C4 /* LexAHKL.cxx in Sources */,
|
||||
D47A4385B56AE95213274BCA /* LexCSV.cxx in Sources */,
|
||||
898147D7A30DC7659F81C329 /* LexDart.cxx in Sources */,
|
||||
78C242448D1B0F2D11D9507A /* LexerUtils.cxx in Sources */,
|
||||
B86F4DCE947423481A4C76FF /* LexKotlin.cxx in Sources */,
|
||||
216B4BF89D484F772E537525 /* LexTOML.cxx in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -834,7 +858,7 @@
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 5.0.0;
|
||||
CURRENT_PROJECT_VERSION = 5.0.1;
|
||||
DEVELOPMENT_TEAM = 4F446KW87E;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
@ -860,7 +884,7 @@
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 5.0.0;
|
||||
CURRENT_PROJECT_VERSION = 5.0.1;
|
||||
DEVELOPMENT_TEAM = 4F446KW87E;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define VERSION_LEXILLA "5.0.0"
|
||||
#define VERSION_WORDS 5, 0, 0, 0
|
||||
#define VERSION_LEXILLA "5.0.1"
|
||||
#define VERSION_WORDS 5, 0, 1, 0
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VERSION_WORDS
|
||||
|
||||
@ -429,23 +429,6 @@ LexProps.o: \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/LexerModule.h
|
||||
LexPython.o: \
|
||||
../lexers/LexPython.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
../../scintilla/include/Sci_Position.h \
|
||||
../../scintilla/include/Scintilla.h \
|
||||
../include/SciLexer.h \
|
||||
../lexlib/StringCopy.h \
|
||||
../lexlib/WordList.h \
|
||||
../lexlib/LexAccessor.h \
|
||||
../lexlib/Accessor.h \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/CharacterCategory.h \
|
||||
../lexlib/LexerModule.h \
|
||||
../lexlib/OptionSet.h \
|
||||
../lexlib/SubStyles.h \
|
||||
../lexlib/DefaultLexer.h
|
||||
LexR.o: \
|
||||
../lexers/LexR.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
@ -615,6 +598,18 @@ LexDart.o: \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexers_x/SciXLexer.h \
|
||||
../include/SciLexer.h \
|
||||
../lexers_x/StringUtils.h \
|
||||
../lexers_x/LexerUtils.h
|
||||
LexerUtils.o: \
|
||||
../lexers_x/LexerUtils.cxx \
|
||||
../../scintilla/include/Scintilla.h \
|
||||
../../scintilla/include/Sci_Position.h \
|
||||
../../scintilla/include/ILexer.h \
|
||||
../lexlib/LexAccessor.h \
|
||||
../lexers_x/CharSetX.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexers_x/StringUtils.h \
|
||||
../lexers_x/LexerUtils.h
|
||||
LexJSON.o: \
|
||||
../lexers_x/LexJSON.cxx \
|
||||
@ -649,7 +644,25 @@ LexKotlin.o: \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexers_x/SciXLexer.h \
|
||||
../include/SciLexer.h \
|
||||
../lexers_x/StringUtils.h \
|
||||
../lexers_x/LexerUtils.h
|
||||
LexPython.o: \
|
||||
../lexers_x/LexPython.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
../../scintilla/include/Sci_Position.h \
|
||||
../../scintilla/include/Scintilla.h \
|
||||
../include/SciLexer.h \
|
||||
../lexlib/StringCopy.h \
|
||||
../lexlib/WordList.h \
|
||||
../lexlib/LexAccessor.h \
|
||||
../lexlib/Accessor.h \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/CharacterCategory.h \
|
||||
../lexlib/LexerModule.h \
|
||||
../lexlib/OptionSet.h \
|
||||
../lexlib/SubStyles.h \
|
||||
../lexlib/DefaultLexer.h
|
||||
LexTOML.o: \
|
||||
../lexers_x/LexTOML.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
|
||||
@ -429,23 +429,6 @@ $(DIR_O)/LexProps.obj: \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/LexerModule.h
|
||||
$(DIR_O)/LexPython.obj: \
|
||||
../lexers/LexPython.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
../../scintilla/include/Sci_Position.h \
|
||||
../../scintilla/include/Scintilla.h \
|
||||
../include/SciLexer.h \
|
||||
../lexlib/StringCopy.h \
|
||||
../lexlib/WordList.h \
|
||||
../lexlib/LexAccessor.h \
|
||||
../lexlib/Accessor.h \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/CharacterCategory.h \
|
||||
../lexlib/LexerModule.h \
|
||||
../lexlib/OptionSet.h \
|
||||
../lexlib/SubStyles.h \
|
||||
../lexlib/DefaultLexer.h
|
||||
$(DIR_O)/LexR.obj: \
|
||||
../lexers/LexR.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
@ -615,6 +598,18 @@ $(DIR_O)/LexDart.obj: \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexers_x/SciXLexer.h \
|
||||
../include/SciLexer.h \
|
||||
../lexers_x/StringUtils.h \
|
||||
../lexers_x/LexerUtils.h
|
||||
$(DIR_O)/LexerUtils.obj: \
|
||||
../lexers_x/LexerUtils.cxx \
|
||||
../../scintilla/include/Scintilla.h \
|
||||
../../scintilla/include/Sci_Position.h \
|
||||
../../scintilla/include/ILexer.h \
|
||||
../lexlib/LexAccessor.h \
|
||||
../lexers_x/CharSetX.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexers_x/StringUtils.h \
|
||||
../lexers_x/LexerUtils.h
|
||||
$(DIR_O)/LexJSON.obj: \
|
||||
../lexers_x/LexJSON.cxx \
|
||||
@ -649,7 +644,25 @@ $(DIR_O)/LexKotlin.obj: \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexers_x/SciXLexer.h \
|
||||
../include/SciLexer.h \
|
||||
../lexers_x/StringUtils.h \
|
||||
../lexers_x/LexerUtils.h
|
||||
$(DIR_O)/LexPython.obj: \
|
||||
../lexers_x/LexPython.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
../../scintilla/include/Sci_Position.h \
|
||||
../../scintilla/include/Scintilla.h \
|
||||
../include/SciLexer.h \
|
||||
../lexlib/StringCopy.h \
|
||||
../lexlib/WordList.h \
|
||||
../lexlib/LexAccessor.h \
|
||||
../lexlib/Accessor.h \
|
||||
../lexlib/StyleContext.h \
|
||||
../lexlib/CharacterSet.h \
|
||||
../lexlib/CharacterCategory.h \
|
||||
../lexlib/LexerModule.h \
|
||||
../lexlib/OptionSet.h \
|
||||
../lexlib/SubStyles.h \
|
||||
../lexlib/DefaultLexer.h
|
||||
$(DIR_O)/LexTOML.obj: \
|
||||
../lexers_x/LexTOML.cxx \
|
||||
../../scintilla/include/ILexer.h \
|
||||
|
||||
@ -1 +1 @@
|
||||
500
|
||||
501
|
||||
|
||||
@ -5,30 +5,38 @@
|
||||
KEYWORDLIST KeyWords_CPP =
|
||||
{
|
||||
// Primary keywords
|
||||
"_Alignas _Alignof _Atomic _Bool _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local alignas "
|
||||
"alignof auto bool break case catch char char16_t char32_t class const const_cast constexpr continue "
|
||||
"decltype default defined delete do double dynamic_cast else enum explicit export extern false float for "
|
||||
"friend goto if inline int long mutable naked namespace new noexcept noreturn nullptr operator private "
|
||||
"protected public register reinterpret_cast restrict return short signed sizeof static static_assert "
|
||||
"static_cast struct switch template this thread_local throw true try typedef typeid typename union "
|
||||
"unsigned using virtual void volatile wchar_t while",
|
||||
"alignas alignof asm audit auto axiom bitand bitor bool break case catch char class compl concept "
|
||||
"const const_cast consteval constexpr continue co_await co_return co_yield "
|
||||
"decltype default defined delete do double dynamic_cast else enum explicit export extern false final float for "
|
||||
"friend goto if import inline int long module mutable naked namespace new noexcept not not_eq noreturn nullptr "
|
||||
"operator or or_eq override private protected public "
|
||||
"register reinterpret_cast requires restrict return "
|
||||
"short signed sizeof static static_assert static_cast struct switch "
|
||||
"template this thread_local throw true try typedef typeid typename "
|
||||
"union unsigned using virtual void volatile while xor xor_eq",
|
||||
// Secondary keywords
|
||||
"_Alignas _Alignof _Atomic _Bool _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local "
|
||||
"_Pragma __DATE__ __FILE__ __LINE__ __STDCPP_DEFAULT_NEW_ALIGNMENT__ __STDCPP_STRICT_POINTER_SAFETY__ "
|
||||
"__STDCPP_THREADS__ __STDC_HOSTED__ __STDC_ISO_10646__ __STDC_MB_MIGHT_NEQ_WC__ __STDC_UTF_16__ "
|
||||
"__STDC_UTF_32__ __STDC_VERSION__ __STDC__ __TIME__ __VA_ARGS__ __VA_OPT__ __abstract __alignof __asm "
|
||||
"__assume __based __box __cdecl __cplusplus __declspec __delegate __event __except __except__try "
|
||||
"__fastcall __finally __gc __has_include __hook __identifier __if_exists __if_not_exists __inline "
|
||||
"__interface __leave __multiple_inheritance __nogc __noop __pin __property __raise __sealed "
|
||||
"__single_inheritance __stdcall __super __try __try_cast __unhook __uuidof __value __virtual_inheritance "
|
||||
"asm final override",
|
||||
"__single_inheritance __stdcall __super __try __try_cast __unhook __uuidof __value __virtual_inheritance",
|
||||
// Documentation comment keywords
|
||||
"",
|
||||
"addindex addtogroup anchor arg attention author b brief bug c class code date def defgroup deprecated dontinclude "
|
||||
"e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception f$ f[f] file"
|
||||
"hideinitializer htmlinclude htmlonly if image include ingroup internal invariant interface latexonly li line link "
|
||||
"mainpage name namespace nosubgrouping note overload p page par param param[in] param[out] post pre "
|
||||
"ref relates remarks return retval sa section see showinitializer since skip skipline struct subsection "
|
||||
"test throw throws todo typedef union until var verbatim verbinclude version warning weakgroup",
|
||||
// Global classes and typedefs
|
||||
"__int16 __int32 __int64 __int8 __m128 __m128d __m128i __m64 __wchar_t complex imaginary int16_t int32_t "
|
||||
"int64_t int8_t intmax_t intptr_t ptrdiff_t size_t uint16_t uint32_t uint64_t uint8_t uintmax_t uintptr_t",
|
||||
"__int16 __int32 __int64 __int8 __m128 __m128d __m128i __m64 __wchar_t char16_t char32_t complex imaginary int16_t int32_t "
|
||||
"int64_t int8_t intmax_t intptr_t ptrdiff_t size_t uint16_t uint32_t uint64_t uint8_t uintmax_t uintptr_t wchar_t",
|
||||
// Preprocessor definitions
|
||||
"DEBUG NDEBUG UNICODE _DEBUG _MSC_VER _UNICODE",
|
||||
// Task marker and error marker keywords
|
||||
"BUG FIXME HACK NOTE TBD TODO UNDONE XXX",
|
||||
NULL,
|
||||
};
|
||||
|
||||
@ -39,17 +47,21 @@ EDITLEXER lexCPP =
|
||||
{ {STYLE_DEFAULT}, IDS_LEX_STR_63126, L"Default", L"", L"" },
|
||||
//{ {SCE_C_DEFAULT}, IDS_LEX_STR_63126, L"Default", L"", L"" },
|
||||
{ {SCE_C_IDENTIFIER}, IDS_LEX_STR_63129, L"Identifier", L"", L"" },
|
||||
{ {SCE_C_COMMENT}, IDS_LEX_STR_63127, L"Comment", L"fore:#008000", L"" },
|
||||
{ {MULTI_STYLE(SCE_C_COMMENT,SCE_C_COMMENTLINE,0,0)}, IDS_LEX_STR_63127, L"Comment", L"fore:#008000", L"" },
|
||||
{ {SCE_C_WORD}, IDS_LEX_STR_63128, L"Keyword", L"bold; fore:#0A246A", L"" },
|
||||
{ {SCE_C_WORD2}, IDS_LEX_STR_63260, L"Keyword 2nd", L"bold; italic; fore:#3C6CDD", L"" },
|
||||
{ {SCE_C_GLOBALCLASS}, IDS_LEX_STR_63258, L"Typedefs/Classes", L"bold; italic; fore:#800000", L"" },
|
||||
{ {MULTI_STYLE(SCE_C_STRING,SCE_C_CHARACTER,SCE_C_STRINGEOL,SCE_C_VERBATIM)}, IDS_LEX_STR_63131, L"String", L"fore:#008000", L"" },
|
||||
{ {SCE_C_STRING}, IDS_LEX_STR_63131, L"String", L"fore:#008000", L"" },
|
||||
{ {SCE_C_NUMBER}, IDS_LEX_STR_63130, L"Number", L"fore:#FF0000", L"" },
|
||||
{ {SCE_C_OPERATOR}, IDS_LEX_STR_63132, L"Operator", L"fore:#B000B0", L"" },
|
||||
{ {MULTI_STYLE(SCE_C_PREPROCESSOR,SCE_C_PREPROCESSORCOMMENT,SCE_C_PREPROCESSORCOMMENTDOC,0)}, IDS_LEX_STR_63133, L"Preprocessor", L"fore:#FF8000", L"" },
|
||||
{ {MULTI_STYLE(SCE_C_VERBATIM,SCE_C_TRIPLEVERBATIM,0,0)}, IDS_LEX_STR_63134, L"Verbatim", L"fore:#B000B0", L"" },
|
||||
{ {MULTI_STYLE(SCE_C_COMMENTDOC,SCE_C_COMMENTLINEDOC,SCE_C_COMMENTDOCKEYWORD, SCE_C_COMMENTDOCKEYWORDERROR)}, IDS_LEX_STR_63259, L"Comment Doc", L"fore:#808080", L"" },
|
||||
{ {SCE_C_TASKMARKER}, IDS_LEX_STR_63373, L"Task Marker", L"bold; fore:#208080", L"" },
|
||||
//{ {SCE_C_UUID}, L"UUID", L"", L"" },
|
||||
//{ {SCE_C_REGEX}, L"Regex", L"", L"" },
|
||||
//{ {SCE_C_USERLITERAL}, L"User Literal", L"", L"" },
|
||||
//{ {SCE_C_ESCAPESEQUENCE}, L"Esc Seq", L"", L"" },
|
||||
EDITLEXER_SENTINEL
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -99,9 +99,9 @@ EDITLEXER lexKotlin =
|
||||
{ { SCE_KOTLIN_ENUM }, IDS_LEX_STR_63203, L"Enumeration", L"fore:#FF8000", L"" },
|
||||
{ { SCE_KOTLIN_FUNCTION }, IDS_LEX_STR_63277, L"Function", L"fore:#A46000", L"" },
|
||||
{ { MULTI_STYLE(SCE_KOTLIN_COMMENTBLOCK, SCE_KOTLIN_COMMENTLINE, 0, 0) }, IDS_LEX_STR_63127, L"Comment", L"fore:#608060", L"" },
|
||||
{ { SCE_KOTLIN_COMMENTDOCWORD }, IDS_LEX_STR_63371, L"Comment Doc Word", L"fore:#408080", L"" },
|
||||
{ { SCE_KOTLIN_TASKMARKER }, IDS_LEX_STR_63373, L"Task Marker", L"bold; fore:#408080" },
|
||||
{ { MULTI_STYLE(SCE_KOTLIN_COMMENTBLOCKDOC, SCE_KOTLIN_COMMENTLINEDOC, 0, 0) }, IDS_LEX_STR_63259, L"Comment Doc", L"fore:#408080", L"" },
|
||||
{ { SCE_KOTLIN_COMMENTDOCWORD }, IDS_LEX_STR_63371, L"Comment Doc Word", L"fore:#408080", L"" },
|
||||
{ { SCE_KOTLIN_TASKMARKER }, IDS_LEX_STR_63373, L"Task Marker", L"bold; fore:#208080" },
|
||||
{ { MULTI_STYLE(SCE_KOTLIN_CHARACTER, SCE_KOTLIN_STRING, 0, 0) }, IDS_LEX_STR_63131, L"String", L"fore:#008000", L"" },
|
||||
{ { MULTI_STYLE(SCE_KOTLIN_RAWSTRING, SCE_KOTLIN_RAWSTRINGSTART, SCE_KOTLIN_RAWSTRINGEND, 0) }, IDS_LEX_STR_63134, L"Verbatim String", L"fore:#F08000", L"" },
|
||||
{ { SCE_KOTLIN_ESCAPECHAR }, IDS_LEX_STR_63366, L"ESC Sequence", L"fore:#0080C0", L"" },
|
||||
|
||||
229
src/Styles.c
229
src/Styles.c
@ -1470,118 +1470,8 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
COUNTOF(s_pLexCurrent->Styles[STY_CTRL_CHR].szValue));
|
||||
|
||||
} else if (s_pLexCurrent->lexerID != SCLEX_NULL) {
|
||||
// -----------------------------------------------
|
||||
int i = 1; // don't re-apply lexer's default style
|
||||
// -----------------------------------------------
|
||||
while (s_pLexCurrent->Styles[i].iStyle != -1) {
|
||||
// apply MULTI_STYLE() MACRO
|
||||
for (int j = 0; j < 4 && (s_pLexCurrent->Styles[i].iStyle8[j] != 0 || j == 0); ++j) {
|
||||
Style_SetStyles(hwnd, s_pLexCurrent->Styles[i].iStyle8[j], s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_HTML && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_HPHP_DEFAULT) {
|
||||
int iRelated[] = { SCE_HPHP_COMMENT, SCE_HPHP_COMMENTLINE, SCE_HPHP_WORD, SCE_HPHP_HSTRING, SCE_HPHP_SIMPLESTRING, SCE_HPHP_NUMBER,
|
||||
SCE_HPHP_OPERATOR, SCE_HPHP_VARIABLE, SCE_HPHP_HSTRING_VARIABLE, SCE_HPHP_COMPLEX_VARIABLE
|
||||
};
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd,iRelated[j],s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_HTML && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_HJ_DEFAULT) {
|
||||
int iRelated[] = { SCE_HJ_COMMENT, SCE_HJ_COMMENTLINE, SCE_HJ_COMMENTDOC, SCE_HJ_KEYWORD, SCE_HJ_WORD, SCE_HJ_DOUBLESTRING,
|
||||
SCE_HJ_SINGLESTRING, SCE_HJ_STRINGEOL, SCE_HJ_REGEX, SCE_HJ_NUMBER, SCE_HJ_SYMBOLS
|
||||
};
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd,iRelated[j],s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_HTML && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_HJA_DEFAULT) {
|
||||
int iRelated[] = { SCE_HJA_COMMENT, SCE_HJA_COMMENTLINE, SCE_HJA_COMMENTDOC, SCE_HJA_KEYWORD, SCE_HJA_WORD, SCE_HJA_DOUBLESTRING,
|
||||
SCE_HJA_SINGLESTRING, SCE_HJA_STRINGEOL, SCE_HJA_REGEX, SCE_HJA_NUMBER, SCE_HJA_SYMBOLS
|
||||
};
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd,iRelated[j],s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_HTML && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_HB_DEFAULT) {
|
||||
int iRelated[] = { SCE_HB_COMMENTLINE, SCE_HB_WORD, SCE_HB_IDENTIFIER, SCE_HB_STRING, SCE_HB_STRINGEOL, SCE_HB_NUMBER };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd,iRelated[j],s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_HTML && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_HBA_DEFAULT) {
|
||||
int iRelated[] = { SCE_HBA_COMMENTLINE, SCE_HBA_WORD, SCE_HBA_IDENTIFIER, SCE_HBA_STRING, SCE_HBA_STRINGEOL, SCE_HBA_NUMBER };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd,iRelated[j],s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if ((s_pLexCurrent->lexerID == SCLEX_HTML || s_pLexCurrent->lexerID == SCLEX_XML) && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_H_SGML_DEFAULT) {
|
||||
int iRelated[] = { SCE_H_SGML_COMMAND, SCE_H_SGML_1ST_PARAM, SCE_H_SGML_DOUBLESTRING, SCE_H_SGML_SIMPLESTRING, SCE_H_SGML_ERROR,
|
||||
SCE_H_SGML_SPECIAL, SCE_H_SGML_ENTITY, SCE_H_SGML_COMMENT, SCE_H_SGML_1ST_PARAM_COMMENT, SCE_H_SGML_BLOCK_DEFAULT
|
||||
};
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd,iRelated[j],s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if ((s_pLexCurrent->lexerID == SCLEX_HTML || s_pLexCurrent->lexerID == SCLEX_XML) && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_H_CDATA) {
|
||||
int iRelated[] = { SCE_HP_START, SCE_HP_DEFAULT, SCE_HP_COMMENTLINE, SCE_HP_NUMBER, SCE_HP_STRING,
|
||||
SCE_HP_CHARACTER, SCE_HP_WORD, SCE_HP_TRIPLE, SCE_HP_TRIPLEDOUBLE, SCE_HP_CLASSNAME,
|
||||
SCE_HP_DEFNAME, SCE_HP_OPERATOR, SCE_HP_IDENTIFIER, SCE_HPA_START, SCE_HPA_DEFAULT,
|
||||
SCE_HPA_COMMENTLINE, SCE_HPA_NUMBER, SCE_HPA_STRING, SCE_HPA_CHARACTER, SCE_HPA_WORD,
|
||||
SCE_HPA_TRIPLE, SCE_HPA_TRIPLEDOUBLE, SCE_HPA_CLASSNAME, SCE_HPA_DEFNAME, SCE_HPA_OPERATOR,
|
||||
SCE_HPA_IDENTIFIER
|
||||
};
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd,iRelated[j],s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_XML && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_H_CDATA) {
|
||||
int iRelated[] = { SCE_H_SCRIPT, SCE_H_ASP, SCE_H_ASPAT, SCE_H_QUESTION,
|
||||
SCE_HPHP_DEFAULT, SCE_HPHP_COMMENT, SCE_HPHP_COMMENTLINE, SCE_HPHP_WORD, SCE_HPHP_HSTRING,
|
||||
SCE_HPHP_SIMPLESTRING, SCE_HPHP_NUMBER, SCE_HPHP_OPERATOR, SCE_HPHP_VARIABLE,
|
||||
SCE_HPHP_HSTRING_VARIABLE, SCE_HPHP_COMPLEX_VARIABLE, SCE_HJ_START, SCE_HJ_DEFAULT,
|
||||
SCE_HJ_COMMENT, SCE_HJ_COMMENTLINE, SCE_HJ_COMMENTDOC, SCE_HJ_KEYWORD, SCE_HJ_WORD,
|
||||
SCE_HJ_DOUBLESTRING, SCE_HJ_SINGLESTRING, SCE_HJ_STRINGEOL, SCE_HJ_REGEX, SCE_HJ_NUMBER,
|
||||
SCE_HJ_SYMBOLS, SCE_HJA_START, SCE_HJA_DEFAULT, SCE_HJA_COMMENT, SCE_HJA_COMMENTLINE,
|
||||
SCE_HJA_COMMENTDOC, SCE_HJA_KEYWORD, SCE_HJA_WORD, SCE_HJA_DOUBLESTRING, SCE_HJA_SINGLESTRING,
|
||||
SCE_HJA_STRINGEOL, SCE_HJA_REGEX, SCE_HJA_NUMBER, SCE_HJA_SYMBOLS, SCE_HB_START, SCE_HB_DEFAULT,
|
||||
SCE_HB_COMMENTLINE, SCE_HB_WORD, SCE_HB_IDENTIFIER, SCE_HB_STRING, SCE_HB_STRINGEOL,
|
||||
SCE_HB_NUMBER, SCE_HBA_START, SCE_HBA_DEFAULT, SCE_HBA_COMMENTLINE, SCE_HBA_WORD,
|
||||
SCE_HBA_IDENTIFIER, SCE_HBA_STRING, SCE_HBA_STRINGEOL, SCE_HBA_NUMBER, SCE_HP_START,
|
||||
SCE_HP_DEFAULT, SCE_HP_COMMENTLINE, SCE_HP_NUMBER, SCE_HP_STRING, SCE_HP_CHARACTER, SCE_HP_WORD,
|
||||
SCE_HP_TRIPLE, SCE_HP_TRIPLEDOUBLE, SCE_HP_CLASSNAME, SCE_HP_DEFNAME, SCE_HP_OPERATOR,
|
||||
SCE_HP_IDENTIFIER, SCE_HPA_START, SCE_HPA_DEFAULT, SCE_HPA_COMMENTLINE, SCE_HPA_NUMBER,
|
||||
SCE_HPA_STRING, SCE_HPA_CHARACTER, SCE_HPA_WORD, SCE_HPA_TRIPLE, SCE_HPA_TRIPLEDOUBLE,
|
||||
SCE_HPA_CLASSNAME, SCE_HPA_DEFNAME, SCE_HPA_OPERATOR, SCE_HPA_IDENTIFIER
|
||||
};
|
||||
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_CPP && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_C_COMMENT) {
|
||||
int iRelated[] = { SCE_C_COMMENTLINE, SCE_C_COMMENTDOC, SCE_C_COMMENTLINEDOC, SCE_C_COMMENTDOCKEYWORD, SCE_C_COMMENTDOCKEYWORDERROR };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_pLexCurrent->lexerID == SCLEX_SQL && s_pLexCurrent->Styles[i].iStyle8[0] == SCE_SQL_COMMENT) {
|
||||
int iRelated[] = { SCE_SQL_COMMENTLINE, SCE_SQL_COMMENTDOC, SCE_SQL_COMMENTLINEDOC, SCE_SQL_COMMENTDOCKEYWORD, SCE_SQL_COMMENTDOCKEYWORDERROR };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], s_pLexCurrent->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
Style_FillRelatedStyles(hwnd, s_pLexCurrent);
|
||||
}
|
||||
|
||||
// Lexer reserved indicator styles
|
||||
@ -1635,6 +1525,123 @@ void Style_SetLexer(HWND hwnd, PEDITLEXER pLexNew)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Style_FillRelatedStyles()
|
||||
//
|
||||
void Style_FillRelatedStyles(HWND hwnd, const PEDITLEXER pLexer) {
|
||||
|
||||
// -----------------------------------------------
|
||||
int i = 1; // don't re-apply lexer's default style
|
||||
// -----------------------------------------------
|
||||
while (pLexer->Styles[i].iStyle != -1) {
|
||||
|
||||
// apply MULTI_STYLE() MACRO
|
||||
for (int j = 0; j < 4 && (pLexer->Styles[i].iStyle8[j] != 0 || j == 0); ++j) {
|
||||
Style_SetStyles(hwnd, pLexer->Styles[i].iStyle8[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
|
||||
|
||||
if (pLexer->lexerID == SCLEX_HTML && pLexer->Styles[i].iStyle8[0] == SCE_HPHP_DEFAULT) {
|
||||
int iRelated[] = { SCE_HPHP_COMMENT, SCE_HPHP_COMMENTLINE, SCE_HPHP_WORD, SCE_HPHP_HSTRING, SCE_HPHP_SIMPLESTRING, SCE_HPHP_NUMBER,
|
||||
SCE_HPHP_OPERATOR, SCE_HPHP_VARIABLE, SCE_HPHP_HSTRING_VARIABLE, SCE_HPHP_COMPLEX_VARIABLE };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pLexer->lexerID == SCLEX_HTML && pLexer->Styles[i].iStyle8[0] == SCE_HJ_DEFAULT) {
|
||||
int iRelated[] = { SCE_HJ_COMMENT, SCE_HJ_COMMENTLINE, SCE_HJ_COMMENTDOC, SCE_HJ_KEYWORD, SCE_HJ_WORD, SCE_HJ_DOUBLESTRING,
|
||||
SCE_HJ_SINGLESTRING, SCE_HJ_STRINGEOL, SCE_HJ_REGEX, SCE_HJ_NUMBER, SCE_HJ_SYMBOLS };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pLexer->lexerID == SCLEX_HTML && pLexer->Styles[i].iStyle8[0] == SCE_HJA_DEFAULT) {
|
||||
int iRelated[] = { SCE_HJA_COMMENT, SCE_HJA_COMMENTLINE, SCE_HJA_COMMENTDOC, SCE_HJA_KEYWORD, SCE_HJA_WORD, SCE_HJA_DOUBLESTRING,
|
||||
SCE_HJA_SINGLESTRING, SCE_HJA_STRINGEOL, SCE_HJA_REGEX, SCE_HJA_NUMBER, SCE_HJA_SYMBOLS };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pLexer->lexerID == SCLEX_HTML && pLexer->Styles[i].iStyle8[0] == SCE_HB_DEFAULT) {
|
||||
int iRelated[] = { SCE_HB_COMMENTLINE, SCE_HB_WORD, SCE_HB_IDENTIFIER, SCE_HB_STRING, SCE_HB_STRINGEOL, SCE_HB_NUMBER };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pLexer->lexerID == SCLEX_HTML && pLexer->Styles[i].iStyle8[0] == SCE_HBA_DEFAULT) {
|
||||
int iRelated[] = { SCE_HBA_COMMENTLINE, SCE_HBA_WORD, SCE_HBA_IDENTIFIER, SCE_HBA_STRING, SCE_HBA_STRINGEOL, SCE_HBA_NUMBER };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if ((pLexer->lexerID == SCLEX_HTML || pLexer->lexerID == SCLEX_XML) && pLexer->Styles[i].iStyle8[0] == SCE_H_SGML_DEFAULT) {
|
||||
int iRelated[] = { SCE_H_SGML_COMMAND, SCE_H_SGML_1ST_PARAM, SCE_H_SGML_DOUBLESTRING, SCE_H_SGML_SIMPLESTRING, SCE_H_SGML_ERROR,
|
||||
SCE_H_SGML_SPECIAL, SCE_H_SGML_ENTITY, SCE_H_SGML_COMMENT, SCE_H_SGML_1ST_PARAM_COMMENT, SCE_H_SGML_BLOCK_DEFAULT };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if ((pLexer->lexerID == SCLEX_HTML || pLexer->lexerID == SCLEX_XML) && pLexer->Styles[i].iStyle8[0] == SCE_H_CDATA) {
|
||||
int iRelated[] = { SCE_HP_START, SCE_HP_DEFAULT, SCE_HP_COMMENTLINE, SCE_HP_NUMBER, SCE_HP_STRING,
|
||||
SCE_HP_CHARACTER, SCE_HP_WORD, SCE_HP_TRIPLE, SCE_HP_TRIPLEDOUBLE, SCE_HP_CLASSNAME,
|
||||
SCE_HP_DEFNAME, SCE_HP_OPERATOR, SCE_HP_IDENTIFIER, SCE_HPA_START, SCE_HPA_DEFAULT,
|
||||
SCE_HPA_COMMENTLINE, SCE_HPA_NUMBER, SCE_HPA_STRING, SCE_HPA_CHARACTER, SCE_HPA_WORD,
|
||||
SCE_HPA_TRIPLE, SCE_HPA_TRIPLEDOUBLE, SCE_HPA_CLASSNAME, SCE_HPA_DEFNAME, SCE_HPA_OPERATOR,
|
||||
SCE_HPA_IDENTIFIER };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pLexer->lexerID == SCLEX_XML && pLexer->Styles[i].iStyle8[0] == SCE_H_CDATA) {
|
||||
int iRelated[] = { SCE_H_SCRIPT, SCE_H_ASP, SCE_H_ASPAT, SCE_H_QUESTION,
|
||||
SCE_HPHP_DEFAULT, SCE_HPHP_COMMENT, SCE_HPHP_COMMENTLINE, SCE_HPHP_WORD, SCE_HPHP_HSTRING,
|
||||
SCE_HPHP_SIMPLESTRING, SCE_HPHP_NUMBER, SCE_HPHP_OPERATOR, SCE_HPHP_VARIABLE,
|
||||
SCE_HPHP_HSTRING_VARIABLE, SCE_HPHP_COMPLEX_VARIABLE, SCE_HJ_START, SCE_HJ_DEFAULT,
|
||||
SCE_HJ_COMMENT, SCE_HJ_COMMENTLINE, SCE_HJ_COMMENTDOC, SCE_HJ_KEYWORD, SCE_HJ_WORD,
|
||||
SCE_HJ_DOUBLESTRING, SCE_HJ_SINGLESTRING, SCE_HJ_STRINGEOL, SCE_HJ_REGEX, SCE_HJ_NUMBER,
|
||||
SCE_HJ_SYMBOLS, SCE_HJA_START, SCE_HJA_DEFAULT, SCE_HJA_COMMENT, SCE_HJA_COMMENTLINE,
|
||||
SCE_HJA_COMMENTDOC, SCE_HJA_KEYWORD, SCE_HJA_WORD, SCE_HJA_DOUBLESTRING, SCE_HJA_SINGLESTRING,
|
||||
SCE_HJA_STRINGEOL, SCE_HJA_REGEX, SCE_HJA_NUMBER, SCE_HJA_SYMBOLS, SCE_HB_START, SCE_HB_DEFAULT,
|
||||
SCE_HB_COMMENTLINE, SCE_HB_WORD, SCE_HB_IDENTIFIER, SCE_HB_STRING, SCE_HB_STRINGEOL,
|
||||
SCE_HB_NUMBER, SCE_HBA_START, SCE_HBA_DEFAULT, SCE_HBA_COMMENTLINE, SCE_HBA_WORD,
|
||||
SCE_HBA_IDENTIFIER, SCE_HBA_STRING, SCE_HBA_STRINGEOL, SCE_HBA_NUMBER, SCE_HP_START,
|
||||
SCE_HP_DEFAULT, SCE_HP_COMMENTLINE, SCE_HP_NUMBER, SCE_HP_STRING, SCE_HP_CHARACTER, SCE_HP_WORD,
|
||||
SCE_HP_TRIPLE, SCE_HP_TRIPLEDOUBLE, SCE_HP_CLASSNAME, SCE_HP_DEFNAME, SCE_HP_OPERATOR,
|
||||
SCE_HP_IDENTIFIER, SCE_HPA_START, SCE_HPA_DEFAULT, SCE_HPA_COMMENTLINE, SCE_HPA_NUMBER,
|
||||
SCE_HPA_STRING, SCE_HPA_CHARACTER, SCE_HPA_WORD, SCE_HPA_TRIPLE, SCE_HPA_TRIPLEDOUBLE,
|
||||
SCE_HPA_CLASSNAME, SCE_HPA_DEFNAME, SCE_HPA_OPERATOR, SCE_HPA_IDENTIFIER };
|
||||
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pLexer->lexerID == SCLEX_CPP && pLexer->Styles[i].iStyle8[0] == SCE_C_STRING) {
|
||||
int iRelated[] = { SCE_C_CHARACTER, SCE_C_STRINGEOL, SCE_C_VERBATIM, SCE_C_STRINGRAW, SCE_C_HASHQUOTEDSTRING };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (pLexer->lexerID == SCLEX_SQL && pLexer->Styles[i].iStyle8[0] == SCE_SQL_COMMENT) {
|
||||
int iRelated[] = { SCE_SQL_COMMENTLINE, SCE_SQL_COMMENTDOC, SCE_SQL_COMMENTLINEDOC, SCE_SQL_COMMENTDOCKEYWORD, SCE_SQL_COMMENTDOCKEYWORDERROR };
|
||||
for (int j = 0; j < COUNTOF(iRelated); j++) {
|
||||
Style_SetStyles(hwnd, iRelated[j], pLexer->Styles[i].szValue, false);
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// Style_SetUrlHotSpot()
|
||||
|
||||
@ -51,6 +51,7 @@ void Style_SetFoldingAvailability(PEDITLEXER pLexer);
|
||||
void Style_SetFoldingProperties(bool active);
|
||||
void Style_SetFoldingFocusedView();
|
||||
void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew);
|
||||
void Style_FillRelatedStyles(HWND hwnd, const PEDITLEXER pLexer);
|
||||
void Style_SetUrlHotSpot(HWND hwnd);
|
||||
void Style_SetInvisible(HWND hwnd, bool);
|
||||
void Style_SetReadonly(HWND hwnd, bool);
|
||||
|
||||
@ -1,12 +1,17 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* Config.cpp *
|
||||
* *
|
||||
* TODO: HACK *
|
||||
|
||||
addindex
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include <strsafe.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
// TODO: fkdlkldfdl
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user