Skip to content

Commit

Permalink
+upd: Lexilla Lib v5.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiKoHoff committed Mar 7, 2024
1 parent 9de7014 commit 58897ac
Show file tree
Hide file tree
Showing 14 changed files with 137 additions and 88 deletions.
28 changes: 26 additions & 2 deletions lexilla/cppcheck.suppress
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ passedByValue
// cppcheck 2.11 can't find system headers on Win32.
missingIncludeSystem

// Passing temporary string into hidden object creator functions: they do not hold the argument
danglingTemporaryLifetime:lexilla/access/LexillaAccess.cxx
returnDanglingLifetime:lexilla/access/LexillaAccess.cxx

// cppcheck seems to believe that unique_ptr<char *[]>::get returns void* instead of char**
arithOperationsOnVoidPointer:lexilla/lexlib/WordList.cxx

Expand All @@ -41,6 +45,7 @@ constVariablePointer:lexilla/examples/CheckLexilla/CheckLexilla.c
// Suppress most lexer warnings since the lexers are maintained by others
redundantCondition:lexilla/lexers/LexA68k.cxx
constParameterReference:lexilla/lexers/LexAbaqus.cxx
constParameterReference:lexilla/lexers/LexAda.cxx
constParameterReference:lexilla/lexers/LexAsciidoc.cxx
constParameterCallback:lexilla/lexers/LexAsn1.cxx
knownConditionTrueFalse:lexilla/lexers/LexAU3.cxx
Expand All @@ -53,16 +58,20 @@ constParameterReference:lexilla/lexers/LexBash.cxx
knownConditionTrueFalse:lexilla/lexers/LexBash.cxx
variableScope:lexilla/lexers/LexBash.cxx
constVariable:lexilla/lexers/LexBasic.cxx
variableScope:lexilla/lexers/LexCmake.cxx
knownConditionTrueFalse:lexilla/lexers/LexCmake.cxx
constParameterReference:lexilla/lexers/LexCLW.cxx
knownConditionTrueFalse:lexilla/lexers/LexCLW.cxx
variableScope:lexilla/lexers/LexCmake.cxx
knownConditionTrueFalse:lexilla/lexers/LexCmake.cxx
constParameterReference:lexilla/lexers/LexCmake.cxx
constParameterReference: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
knownConditionTrueFalse:lexilla/lexers/LexDataflex.cxx
constParameterReference:lexilla/lexers/LexDataflex.cxx
variableScope:lexilla/lexers/LexDataflex.cxx
knownConditionTrueFalse:lexilla/lexers/LexECL.cxx
variableScope:lexilla/lexers/LexECL.cxx
Expand All @@ -75,6 +84,7 @@ constParameter:lexilla/lexers/LexFortran.cxx
constParameterReference:lexilla/lexers/LexFortran.cxx
redundantContinue:lexilla/lexers/LexFortran.cxx
knownConditionTrueFalse:lexilla/lexers/LexFSharp.cxx
constParameterReference:lexilla/lexers/LexGAP.cxx
constParameterReference:lexilla/lexers/LexGDScript.cxx
variableScope:lexilla/lexers/LexGui4Cli.cxx
constParameterReference:lexilla/lexers/LexHaskell.cxx
Expand All @@ -83,6 +93,8 @@ knownConditionTrueFalse:lexilla/lexers/LexHex.cxx
constParameterReference:lexilla/lexers/LexHTML.cxx
constVariable:lexilla/lexers/LexHollywood.cxx
variableScope:lexilla/lexers/LexInno.cxx
constVariableReference:lexilla/lexers/LexInno.cxx
constParameterReference:lexilla/lexers/LexJSON.cxx
constParameterPointer:lexilla/lexers/LexJulia.cxx
constParameterReference:lexilla/lexers/LexJulia.cxx
knownConditionTrueFalse:lexilla/lexers/LexJulia.cxx
Expand All @@ -108,18 +120,24 @@ constParameterReference:lexilla/lexers/LexNimrod.cxx
knownConditionTrueFalse:lexilla/lexers/LexNimrod.cxx
variableScope:lexilla/lexers/LexNimrod.cxx
variableScope:lexilla/lexers/LexNsis.cxx
constParameterReference:lexilla/lexers/LexNsis.cxx
knownConditionTrueFalse:lexilla/lexers/LexNsis.cxx
variableScope:lexilla/lexers/LexOpal.cxx
constParameterReference:lexilla/lexers/LexOpal.cxx
knownConditionTrueFalse:lexilla/lexers/LexOpal.cxx
constParameterReference:lexilla/lexers/LexOScript.cxx
constParameterReference:lexilla/lexers/LexPascal.cxx
variableScope:lexilla/lexers/LexPB.cxx
constParameterReference:lexilla/lexers/LexPerl.cxx
constVariableReference:lexilla/lexers/LexPerl.cxx
knownConditionTrueFalse:lexilla/lexers/LexPerl.cxx
constParameterReference:lexilla/lexers/LexPLM.cxx
constParameterReference:lexilla/lexers/LexPO.cxx
constParameterReference:lexilla/lexers/LexPython.cxx
shadowVariable:lexilla/lexers/LexPowerPro.cxx
knownConditionTrueFalse:lexilla/lexers/LexPowerPro.cxx
variableScope:lexilla/lexers/LexProgress.cxx
constParameterReference:lexilla/lexers/LexProgress.cxx
constParameterReference:lexilla/lexers/LexRaku.cxx
variableScope:lexilla/lexers/LexRaku.cxx
redundantInitialization:lexilla/lexers/LexRegistry.cxx
Expand All @@ -128,10 +146,14 @@ constParameterReference:lexilla/lexers/LexRust.cxx
knownConditionTrueFalse:lexilla/lexers/LexScriptol.cxx
variableScope:lexilla/lexers/LexSpecman.cxx
unreadVariable:lexilla/lexers/LexSpice.cxx
constParameterReference:lexilla/lexers/LexSpice.cxx
constParameterReference:lexilla/lexers/LexSTTXT.cxx
constParameterReference:lexilla/lexers/LexTACL.cxx
knownConditionTrueFalse:lexilla/lexers/LexTACL.cxx
clarifyCalculation:lexilla/lexers/LexTADS3.cxx
constParameterReference:lexilla/lexers/LexTADS3.cxx
constParameterReference:lexilla/lexers/LexTAL.cxx
constVariableReference:lexilla/lexers/LexTCL.cxx
invalidscanf:lexilla/lexers/LexTCMD.cxx
constParameterReference:lexilla/lexers/LexTeX.cxx
variableScope:lexilla/lexers/LexTeX.cxx
Expand All @@ -149,6 +171,7 @@ variableScope:lexilla/lexers/LexVHDL.cxx
unreadVariable:lexilla/lexers/LexVisualProlog.cxx
variableScope:lexilla/lexers/LexVisualProlog.cxx
shiftTooManyBitsSigned:lexilla/lexers/LexVisualProlog.cxx
iterateByValue:lexilla/lexers/LexVisualProlog.cxx
unreadVariable:lexilla/lexers/LexX12.cxx
constVariableReference:lexilla/lexers/LexX12.cxx
constParameterPointer:lexilla/lexers/LexX12.cxx
Expand All @@ -165,6 +188,7 @@ constParameterCallback:lexilla/lexers/LexPython.cxx
constParameterCallback:lexilla/lexers/LexScriptol.cxx
constParameterCallback:lexilla/lexers/LexVB.cxx

constVariableReference:lexilla/lexers/LexBibTeX.cxx
constVariableReference:lexilla/lexers/LexCSS.cxx
constVariableReference:lexilla/lexers/LexCrontab.cxx
constVariableReference:lexilla/lexers/LexGui4Cli.cxx
Expand Down
8 changes: 4 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="20231227" />
<meta name="Date.Modified" content="20240305" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.logo {
Expand Down Expand Up @@ -61,8 +61,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.3.0<br />
Site last modified December 27 2023</font>
<font color="#FFCC99" size="3">Release version 5.3.1<br />
Site last modified March 5 2024</font>
</td>
<td width="20%">
&nbsp;
Expand All @@ -77,11 +77,11 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 5.3.1 improves Assembler, Bash, Batch, JavaScript, Python, and Ruby.</li>
<li>Version 5.3.0 improves Bash, HTML, and Lua.</li>
<li>Version 5.2.9 fixes potential problems on macOS 12 and older when built with Xcode 15.0.</li>
<li>Version 5.2.8 improves Python and R.</li>
<li>Version 5.2.7 improves Bash, F#, and HTML.</li>
<li>Version 5.2.6 improves Bash, Errorlist, HTML, Matlab, and Visual Prolog.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
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/lexilla530.zip">
<font size="4"> <a href="https://www.scintilla.org/lexilla531.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/lexilla530.tgz">
<a href="https://www.scintilla.org/lexilla531.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
Expand All @@ -42,16 +42,16 @@ <h2>
containing very few restrictions.
</p>
<h3>
Release 5.3.0
Release 5.3.1
</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/lexilla530.zip">zip format</a> (1.3M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla530.tgz">tgz format</a> (0.9M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/lexilla531.zip">zip format</a> (1.3M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla531.tgz">tgz format</a> (0.9M) 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
15 changes: 14 additions & 1 deletion lexilla/doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -593,12 +593,16 @@ <h3>
</h3>
<ul>
<li>
Released 27 December 2023.
Released 5 March 2024.
</li>
<li>
Assembler: After comments, treat \r\n line ends the same as \n. This makes testing easier.
</li>
<li>
Bash: Fix folding when line changed to/from comment and previous line is comment.
<a href="https://github.com/ScintillaOrg/lexilla/issues/224">Issue #224</a>.
</li>
<li>
Batch: Fix handling ':' next to keywords.
<a href="https://github.com/ScintillaOrg/lexilla/issues/222">Issue #222</a>.
</li>
Expand All @@ -607,6 +611,15 @@ <h3>
strings as template literals which allow embedded ${expressions}.
<a href="https://github.com/ScintillaOrg/lexilla/issues/94">Issue #94</a>.
</li>
<li>
Python: fix lexing of rb'' and rf'' strings.
<a href="https://github.com/ScintillaOrg/lexilla/issues/223">Issue #223</a>,
<a href="https://github.com/ScintillaOrg/lexilla/pull/227">Pull request #227</a>.
</li>
<li>
Ruby: fix lexing of methods on numeric literals like '3.times' so the '.' and method name do not appear in numeric style.
<a href="https://github.com/ScintillaOrg/lexilla/issues/225">Issue #225</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla530.zip">Release 5.3.0</a>
Expand Down
32 changes: 24 additions & 8 deletions lexilla/lexers/LexBash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1189,10 +1189,17 @@ void SCI_METHOD LexerBash::Fold(Sci_PositionU startPos_, Sci_Position length, in

LexAccessor styler(pAccess);

const Sci_Position startPos = startPos_;
Sci_Position startPos = startPos_;
const Sci_Position endPos = startPos + length;
int visibleChars = 0;
Sci_Position lineCurrent = styler.GetLine(startPos);
// Backtrack to previous line in case need to fix its fold status
if (lineCurrent > 0) {
lineCurrent--;
startPos = styler.LineStart(lineCurrent);
initStyle = (startPos > 0) ? styler.StyleIndexAt(startPos - 1) : 0;
}

int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
char chNext = styler[startPos];
Expand All @@ -1217,7 +1224,9 @@ void SCI_METHOD LexerBash::Fold(Sci_PositionU startPos_, Sci_Position length, in
&& !IsCommentLine(lineCurrent + 1, styler))
levelCurrent--;
}
if (style == SCE_SH_WORD) {

switch (style) {
case SCE_SH_WORD:
if ((wordlen + 1) < sizeof(word))
word[wordlen++] = ch;
if (styleNext != style) {
Expand All @@ -1229,16 +1238,18 @@ void SCI_METHOD LexerBash::Fold(Sci_PositionU startPos_, Sci_Position length, in
levelCurrent--;
}
}
}
if (style == SCE_SH_OPERATOR) {
break;

case SCE_SH_OPERATOR:
if (ch == '{') {
levelCurrent++;
} else if (ch == '}') {
levelCurrent--;
}
}
break;

// Here Document folding
if (style == SCE_SH_HERE_DELIM) {
case SCE_SH_HERE_DELIM:
if (stylePrev == SCE_SH_HERE_Q) {
levelCurrent--;
} else if (stylePrev != SCE_SH_HERE_DELIM) {
Expand All @@ -1248,9 +1259,14 @@ void SCI_METHOD LexerBash::Fold(Sci_PositionU startPos_, Sci_Position length, in
}
}
}
} else if (style == SCE_SH_HERE_Q && styleNext == SCE_SH_DEFAULT) {
levelCurrent--;
break;
case SCE_SH_HERE_Q:
if (styleNext == SCE_SH_DEFAULT) {
levelCurrent--;
}
break;
}

if (atEOL) {
int lev = levelPrev;
if (visibleChars == 0 && options.foldCompact)
Expand Down
5 changes: 2 additions & 3 deletions lexilla/lexers/LexLua.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "Scintilla.h"
#include "SciLexer.h"

#include "StringCopy.h"
#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
Expand Down Expand Up @@ -109,7 +108,7 @@ class LexerLua : public DefaultLexer {
OptionSetLua osLua;
public:
explicit LexerLua() :
DefaultLexer("lua", SCLEX_LUA, lexicalClasses, ELEMENTS(lexicalClasses)) {
DefaultLexer("lua", SCLEX_LUA, lexicalClasses, std::size(lexicalClasses)) {
}
~LexerLua() override = default;
void SCI_METHOD Release() noexcept override {
Expand Down Expand Up @@ -405,7 +404,7 @@ void LexerLua::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, I
if (sc.state == SCE_LUA_DEFAULT) {
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
sc.SetState(SCE_LUA_NUMBER);
if (sc.ch == '0' && toupper(sc.chNext) == 'X') {
if (sc.ch == '0' && AnyOf(sc.chNext, 'x', 'X')) {
sc.Forward();
}
} else if (setWordStart.Contains(sc.ch)) {
Expand Down
Loading

0 comments on commit 58897ac

Please sign in to comment.