Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion PowerEditor/src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ bool NppParameters::load()

for (const auto& i : udlFiles)
{
auto udlDoc = new TiXmlDocument(i);
TiXmlDocument* udlDoc = new TiXmlDocument(i);
loadOkay = udlDoc->LoadFile();
if (!loadOkay)
{
Expand Down
17 changes: 13 additions & 4 deletions lexilla/.github/workflows/build-check-win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ name: "Build and check Lexilla on Win32 with Visual C++"
on: [push]

jobs:
# Compile for amd64 and cross-compile for arm64. Tests run only for amd64.
build:

runs-on: windows-latest

strategy:
matrix:
arch:
- amd64
- amd64_arm64
env:
TEST: ${{ matrix.arch == 'amd64' && 'test' || '' }}
steps:
- uses: actions/checkout@v4
- name: Preparing nmake
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
arch: ${{ matrix.arch }}
- name: Install Scintilla source
run: |
pwd
Expand All @@ -24,7 +32,7 @@ jobs:
- name: Unit Test
run: |
cd test/unit
nmake -f test.mak DEBUG=1 test
nmake -f test.mak DEBUG=1 $env:TEST
cd ../..
- name: Build Lexilla
run: |
Expand All @@ -33,14 +41,15 @@ jobs:
cd ..
- uses: actions/upload-artifact@v4
with:
name: lexilla.dll
name: lexilla${{ matrix.arch == 'amd64_arm64' && '-arm64' || '' }}.dll
path: bin/lexilla.dll
- name: Test lexing and folding
run: |
cd test
nmake -f testlexers.mak DEBUG=1 test
nmake -f testlexers.mak DEBUG=1 $env:TEST
cd ..
- name: CheckLexilla C Example
if: matrix.arch == 'amd64'
run: |
cd examples/CheckLexilla
cl -MP CheckLexilla.c -I ../../include -Fe: CheckLexilla
Expand Down
15 changes: 8 additions & 7 deletions lexilla/access/LexillaAccess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
namespace {

#if defined(_WIN32)
typedef FARPROC Function;
typedef HMODULE Module;
using Function = FARPROC;
using Module = HMODULE;
constexpr const char *pathSeparator = "\\";
#else
typedef void *Function;
typedef void *Module;
using Function = void *;
using Module = void *;
constexpr const char *pathSeparator = "/";
#endif

Expand Down Expand Up @@ -164,9 +164,10 @@ bool Lexilla::Load(std::string_view sharedLibraryPaths) {
if (fnLexerCount && fnLexerName) {
const int nLexers = fnLexerCount();
for (int i = 0; i < nLexers; i++) {
char name[100] = "";
constexpr size_t lengthName = 200;
char name[lengthName]{};
fnLexerName(i, name, sizeof(name));
lexers.push_back(name);
lexers.emplace_back(name);
}
}
CreateLexerFn fnCL = FunctionPointer<CreateLexerFn>(
Expand Down Expand Up @@ -268,7 +269,7 @@ std::string Lexilla::NameFromID(int identifier) {
}
}
}
return std::string();
return {};
}

std::vector<std::string> Lexilla::LibraryProperties() {
Expand Down
5 changes: 4 additions & 1 deletion lexilla/cppcheck.suppress
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ variableScope:lexilla/lexers/LexCmake.cxx
knownConditionTrueFalse:lexilla/lexers/LexCmake.cxx
constParameterReference:lexilla/lexers/LexCmake.cxx
constParameterReference:lexilla/lexers/LexCOBOL.cxx
constVariablePointer:lexilla/lexers/LexCOBOL.cxx
constParameterReference:lexilla/lexers/LexCoffeeScript.cxx
constParameterPointer:lexilla/lexers/LexCoffeeScript.cxx
knownConditionTrueFalse:lexilla/lexers/LexCoffeeScript.cxx
constVariableReference:lexilla/lexers/LexConf.cxx
constParameterReference:lexilla/lexers/LexCPP.cxx
variableScope:lexilla/lexers/LexCSS.cxx
constVariablePointer:lexilla/lexers/LexCSS.cxx
knownConditionTrueFalse:lexilla/lexers/LexDataflex.cxx
constParameterReference:lexilla/lexers/LexDataflex.cxx
variableScope:lexilla/lexers/LexDataflex.cxx
Expand Down Expand Up @@ -118,6 +120,7 @@ unreadVariable:lexilla/lexers/LexMatlab.cxx
variableScope:lexilla/lexers/LexMatlab.cxx
variableScope:lexilla/lexers/LexMetapost.cxx
constParameterReference:lexilla/lexers/LexModula.cxx
duplicateBreak:lexilla/lexers/LexModula.cxx
variableScope:lexilla/lexers/LexModula.cxx
constParameterReference:lexilla/lexers/LexMPT.cxx
variableScope:lexilla/lexers/LexMSSQL.cxx
Expand All @@ -140,6 +143,7 @@ constVariableReference:lexilla/lexers/LexPerl.cxx
knownConditionTrueFalse:lexilla/lexers/LexPerl.cxx
constParameterReference:lexilla/lexers/LexPLM.cxx
constParameterReference:lexilla/lexers/LexPO.cxx
constVariablePointer:lexilla/lexers/LexPOV.cxx
constParameterReference:lexilla/lexers/LexPython.cxx
shadowVariable:lexilla/lexers/LexPowerPro.cxx
knownConditionTrueFalse:lexilla/lexers/LexPowerPro.cxx
Expand Down Expand Up @@ -188,7 +192,6 @@ constVariableReference:lexilla/lexers/LexX12.cxx
constParameterPointer:lexilla/lexers/LexX12.cxx
uselessCallsSubstr:lexilla/lexers/LexX12.cxx
constParameterReference:lexilla/lexers/LexYAML.cxx
constParameterPointer:lexilla/lexers/LexYAML.cxx
knownConditionTrueFalse:lexilla/lexers/LexYAML.cxx

// These are due to Accessor::IndentAmount not declaring the callback as taking a const.
Expand Down
9 changes: 5 additions & 4 deletions lexilla/doc/Lexilla.html
Original file line number Diff line number Diff line change
Expand Up @@ -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="20250225" />
<meta name="Date.Modified" content="20250402" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.logo {
Expand Down Expand Up @@ -51,6 +51,7 @@
<title>
Lexilla
</title>
<link rel="canonical" href="https://scintilla.org/Lexilla.html" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table bgcolor="#000000" width="100%" cellspacing="0" cellpadding="0" border="0">
Expand All @@ -61,8 +62,8 @@
<font color="#FFCC99" size="4"> A library of language lexers for use with Scintilla</font>
</td>
<td width="40%" align="right">
<font color="#FFCC99" size="3">Release version 5.4.3<br />
Site last modified February 25 2025</font>
<font color="#FFCC99" size="3">Release version 5.4.4<br />
Site last modified April 2 2025</font>
</td>
<td width="20%">
&nbsp;
Expand All @@ -77,11 +78,11 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 5.4.4 fixes a problem when building for ARM654 on Windows.</li>
<li>Version 5.4.3 improves C++, Modula 3, Pascal, Python, and Ruby.</li>
<li>Version 5.4.2 adds Nix lexer. Improves JavaScript, PHP, Rust, TOML, and Zig.</li>
<li>Version 5.4.1 adds Dart, troff, and Zig lexers. Improves C++, F#, HTML, and Smalltalk.</li>
<li>Version 5.4.0 adds a TOML lexer.</li>
<li>Version 5.3.3 improves HTML, JavaScript, Lua, PHP, and XML.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
Expand Down
1 change: 1 addition & 0 deletions lexilla/doc/LexillaDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Lexilla Documentation</title>
<link rel="canonical" href="https://scintilla.org/LexillaDoc.html" />

<style type="text/css">
<!--
Expand Down
10 changes: 5 additions & 5 deletions lexilla/doc/LexillaDownload.html
Original file line number Diff line number Diff line change
Expand Up @@ -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/lexilla543.zip">
<font size="4"> <a href="https://www.scintilla.org/lexilla544.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/lexilla543.tgz">
<a href="https://www.scintilla.org/lexilla544.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
Expand All @@ -42,16 +42,16 @@ <h2>
containing very few restrictions.
</p>
<h3>
Release 5.4.3
Release 5.4.4
</h3>
<h4>
Source Code
</h4>
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/lexilla543.zip">zip format</a> (1.4M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla543.tgz">tgz format</a> (1.0M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/lexilla544.zip">zip format</a> (1.4M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla544.tgz">tgz format</a> (1.0M) 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>
Expand Down
13 changes: 13 additions & 0 deletions lexilla/doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,22 @@ <h2>Contributors</h2>
<td>Henrik S. Johansen</td>
<td>Ekopalypse</td>
<td>HoTschir</td>
<td>Ahmet Sait</td>
</tr>
</table>
<h2 id="Releases">Releases</h2>
<h3>
<a href="https://www.scintilla.org/lexilla544.zip">Release 5.4.4</a>
</h3>
<ul>
<li>
Released 2 April 2025.
</li>
<li>
Fix building for ARM64.
<a href="https://github.com/ScintillaOrg/lexilla/pull/308">Pull request #308</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla543.zip">Release 5.4.3</a>
</h3>
Expand Down
8 changes: 4 additions & 4 deletions lexilla/lexers/LexBash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ constexpr int translateBashDigit(int ch) noexcept {
return BASH_BASE_ERROR;
}

int getBashNumberBase(char *s) noexcept {
int getBashNumberBase(const char *s) noexcept {
int i = 0;
int base = 0;
while (*s) {
Expand Down Expand Up @@ -164,7 +164,7 @@ bool IsCommentLine(Sci_Position line, LexAccessor &styler) {
const char ch = styler[i];
if (ch == '#')
return true;
else if (ch != ' ' && ch != '\t')
if (ch != ' ' && ch != '\t')
return false;
}
return false;
Expand Down Expand Up @@ -698,7 +698,7 @@ void SCI_METHOD LexerBash::Lex(Sci_PositionU startPos, Sci_Position length, int
identifierStyle = subStyle | insideCommand;
}
// allow keywords ending in a whitespace, meta character or command delimiter
char s2[10];
char s2[10]{};
s2[0] = static_cast<char>(sc.ch);
s2[1] = '\0';
const bool keywordEnds = IsASpace(sc.ch) || setMetaCharacter.Contains(sc.ch) || cmdDelimiter.InList(s2);
Expand Down Expand Up @@ -1140,7 +1140,7 @@ void SCI_METHOD LexerBash::Lex(Sci_PositionU startPos, Sci_Position length, int
}
// handle command delimiters in command Start|Body|Word state, also Test if 'test' or '[]'
if (cmdState < CmdState::DoubleBracket) {
char s[10];
char s[10]{};
s[0] = static_cast<char>(sc.ch);
if (setBashOperator.Contains(sc.chNext)) {
s[1] = static_cast<char>(sc.chNext);
Expand Down
8 changes: 4 additions & 4 deletions lexilla/lexers/LexYAML.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ constexpr bool IsWhiteSpaceOrEOL(char ch) noexcept {
return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r';
}

unsigned int SpaceCount(char* lineBuffer) noexcept {
unsigned int SpaceCount(const char* lineBuffer) noexcept {
if (lineBuffer == nullptr)
return 0;

char* headBuffer = lineBuffer;
const char* headBuffer = lineBuffer;

while (*headBuffer == ' ')
headBuffer++;

return static_cast<unsigned int>(headBuffer - lineBuffer);
}

bool KeywordAtChar(const char* lineBuffer, char* startComment, const WordList &keywords) noexcept {
bool KeywordAtChar(const char* lineBuffer, const char* startComment, const WordList &keywords) noexcept {
if (lineBuffer == nullptr || startComment <= lineBuffer)
return false;
char* endValue = startComment - 1;
const char* endValue = startComment - 1;
while (endValue >= lineBuffer && *endValue == ' ')
endValue--;
Sci_PositionU len = static_cast<Sci_PositionU>(endValue - lineBuffer) + 1;
Expand Down
2 changes: 1 addition & 1 deletion lexilla/src/Lexilla/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>5.4.3</string>
<string>5.4.4</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
4 changes: 2 additions & 2 deletions lexilla/src/Lexilla/Lexilla.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5.4.3;
CURRENT_PROJECT_VERSION = 5.4.4;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4F446KW87E;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down Expand Up @@ -904,7 +904,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5.4.3;
CURRENT_PROJECT_VERSION = 5.4.4;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4F446KW87E;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down
4 changes: 2 additions & 2 deletions lexilla/src/LexillaVersion.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <windows.h>

#define VERSION_LEXILLA "5.4.3"
#define VERSION_WORDS 5, 4, 3, 0
#define VERSION_LEXILLA "5.4.4"
#define VERSION_WORDS 5, 4, 4, 0

VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_WORDS
Expand Down
14 changes: 11 additions & 3 deletions lexilla/src/lexilla.mak
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@

.SUFFIXES: .cxx

DIR_O=.
DIR_O=obj
DIR_BIN=..\bin

LEXILLA=$(DIR_BIN)\lexilla.dll
LIBLEXILLA=$(DIR_BIN)\liblexilla.lib

LD=link

!IF "$(PLATFORM:64=)" == "arm"
ARM64=1
!ENDIF

!IFDEF SUPPORT_XP
ADD_DEFINE=-D_USING_V110_SDK71_
# Different subsystems for 32-bit and 64-bit Windows XP so detect based on Platform
Expand All @@ -33,10 +37,11 @@ SUBSYSTEM=-SUBSYSTEM:WINDOWS,5.02
SUBSYSTEM=-SUBSYSTEM:WINDOWS,5.01
!ENDIF
!ELSE
CETCOMPAT=-CETCOMPAT
!IFDEF ARM64
ADD_DEFINE=-D_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1
SUBSYSTEM=-SUBSYSTEM:WINDOWS,10.00
!ELSE
CETCOMPAT=-CETCOMPAT
!ENDIF
!ENDIF

Expand Down Expand Up @@ -68,7 +73,10 @@ SCINTILLA_INCLUDE = ../../scintilla/include
INCLUDEDIRS=-I../include -I$(SCINTILLA_INCLUDE) -I../lexlib
CXXFLAGS=$(CXXFLAGS) $(INCLUDEDIRS)

all: $(SCINTILLA_INCLUDE) $(LEXILLA) $(LIBLEXILLA)
all: $(SCINTILLA_INCLUDE) $(DIR_O) $(LEXILLA) $(LIBLEXILLA)

$(DIR_O):
mkdir "$(DIR_O)" 2>NUL || cd .

clean:
-del /q $(DIR_O)\*.obj $(DIR_O)\*.o $(DIR_O)\*.pdb \
Expand Down
2 changes: 1 addition & 1 deletion lexilla/test/testlexers.mak
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DEBUG_OPTIONS = -Zi -DEBUG -Od -MTd -DDEBUG $(STATIC_FLAG)
DEBUG_OPTIONS = -O2 -MT -DNDEBUG $(STATIC_FLAG) -GL
!ENDIF

CXXFLAGS = /EHsc /std:c++latest $(DEBUG_OPTIONS) $(INCLUDEDIRS)
CXXFLAGS = /EHsc /std:c++20 $(DEBUG_OPTIONS) $(INCLUDEDIRS)

OBJS = TestLexers.obj TestDocument.obj LexillaAccess.obj

Expand Down
Loading