Skip to content

Commit

Permalink
+upd: Lexilla Lib v5.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiKoHoff committed May 20, 2024
1 parent b5b214a commit 1bfcc1a
Show file tree
Hide file tree
Showing 35 changed files with 675 additions and 564 deletions.
2 changes: 0 additions & 2 deletions lexilla/Lexilla.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<ClInclude Include="lexlib\LexAccessor.h" />
<ClInclude Include="lexlib\LexerBase.h" />
<ClInclude Include="lexlib\LexerModule.h" />
<ClInclude Include="lexlib\LexerNoExceptions.h" />
<ClInclude Include="lexlib\LexerSimple.h" />
<ClInclude Include="lexlib\OptionSet.h" />
<ClInclude Include="lexlib\PropSetSimple.h" />
Expand Down Expand Up @@ -100,7 +99,6 @@
<ClCompile Include="lexlib\LexAccessor.cxx" />
<ClCompile Include="lexlib\LexerBase.cxx" />
<ClCompile Include="lexlib\LexerModule.cxx" />
<ClCompile Include="lexlib\LexerNoExceptions.cxx" />
<ClCompile Include="lexlib\LexerSimple.cxx" />
<ClCompile Include="lexlib\PropSetSimple.cxx" />
<ClCompile Include="lexlib\StyleContext.cxx" />
Expand Down
6 changes: 0 additions & 6 deletions lexilla/Lexilla.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
<ClInclude Include="lexlib\LexerModule.h">
<Filter>lexlib</Filter>
</ClInclude>
<ClInclude Include="lexlib\LexerNoExceptions.h">
<Filter>lexlib</Filter>
</ClInclude>
<ClInclude Include="lexlib\LexerSimple.h">
<Filter>lexlib</Filter>
</ClInclude>
Expand Down Expand Up @@ -239,9 +236,6 @@
<ClCompile Include="lexlib\LexerModule.cxx">
<Filter>lexlib</Filter>
</ClCompile>
<ClCompile Include="lexlib\LexerNoExceptions.cxx">
<Filter>lexlib</Filter>
</ClCompile>
<ClCompile Include="lexlib\LexerSimple.cxx">
<Filter>lexlib</Filter>
</ClCompile>
Expand Down
14 changes: 9 additions & 5 deletions lexilla/cppcheck.suppress
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ useInitializationList
// produces same result on empty collections
useStlAlgorithm

// Common for lexer object destructors
missingOverride

// Some non-explicit constructors are used for conversions or are private to lexers
noExplicitConstructor

Expand All @@ -28,9 +31,6 @@ returnDanglingLifetime:lexilla/access/LexillaAccess.cxx
// cppcheck seems to believe that unique_ptr<char *[]>::get returns void* instead of char**
arithOperationsOnVoidPointer:lexilla/lexlib/WordList.cxx

// This could be fixed but it should be rewritten to use string_view which doesn't have resize
uselessCallsSubstr:lexilla/lexers/LexCPP.cxx

// cppcheck 2.11 limits checking of complex functions unless --check-level=exhaustive but that
// only finds one false issue in LexRuby
checkLevelNormal:lexilla/lexers/LexBash.cxx
Expand Down Expand Up @@ -90,7 +90,6 @@ variableScope:lexilla/lexers/LexGui4Cli.cxx
constParameterReference:lexilla/lexers/LexHaskell.cxx
constParameterReference:lexilla/lexers/LexHex.cxx
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
Expand Down Expand Up @@ -157,7 +156,6 @@ constVariableReference:lexilla/lexers/LexTCL.cxx
invalidscanf:lexilla/lexers/LexTCMD.cxx
constParameterReference:lexilla/lexers/LexTeX.cxx
variableScope:lexilla/lexers/LexTeX.cxx
knownConditionTrueFalse:lexilla/lexers/LexTxt2tags.cxx
knownConditionTrueFalse:lexilla/lexers/LexVB.cxx
constParameterReference:lexilla/lexers/LexVerilog.cxx
variableScope:lexilla/lexers/LexVerilog.cxx
Expand Down Expand Up @@ -209,3 +207,9 @@ knownConditionTrueFalse:lexilla/test/unit/testCharacterSet.cxx

// cppcheck fails REQUIRE from Catch
comparisonOfFuncReturningBoolError:lexilla/test/unit/*.cxx

// cppcheck fails SECTION from Catch
syntaxError:lexilla/test/unit/*.cxx

// argv has a standardised type
constParameter:lexilla/examples/CheckLexilla/CheckLexilla.c
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="20240305" />
<meta name="Date.Modified" content="20240423" />
<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.1<br />
Site last modified March 5 2024</font>
<font color="#FFCC99" size="3">Release version 5.3.2<br />
Site last modified April 23 2024</font>
</td>
<td width="20%">
&nbsp;
Expand All @@ -77,11 +77,11 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 5.3.2 improves COBOL, HTML, Lua, Ruby, and Rust.</li>
<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>
</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/lexilla531.zip">
<font size="4"> <a href="https://www.scintilla.org/lexilla532.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/lexilla531.tgz">
<a href="https://www.scintilla.org/lexilla532.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
Expand All @@ -42,16 +42,16 @@ <h2>
containing very few restrictions.
</p>
<h3>
Release 5.3.1
Release 5.3.2
</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/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>
<li><a href="https://www.scintilla.org/lexilla532.zip">zip format</a> (1.3M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla532.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
70 changes: 69 additions & 1 deletion lexilla/doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,74 @@ <h2>Contributors</h2>
</tr>
</table>
<h2>Releases</h2>
<h3>
<a href="https://www.scintilla.org/lexilla533.zip">Release 5.3.3</a>
</h3>
<ul>
<li>
Released 23 April 2024.
</li>
<li>
Lua: Fix non-ASCII identifiers joined with '.' or ':'.
<a href="https://github.com/ScintillaOrg/lexilla/issues/242">Issue #242</a>.
</li>
<li>
Lua: Fix folding for multi-line SCE_LUA_LITERALSTRING and SCE_LUA_COMMENT
when performed incrementally.
<a href="https://github.com/ScintillaOrg/lexilla/issues/247">Issue #247</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla532.zip">Release 5.3.2</a>
</h3>
<ul>
<li>
Released 23 April 2024.
</li>
<li>
COBOL: Stop string literal continuing over line end.
<a href="https://github.com/ScintillaOrg/lexilla/issues/229">Issue #229</a>.
</li>
<li>
COBOL: Stop doc comment assigning different styles to \r and \n at line end.
<a href="https://github.com/ScintillaOrg/lexilla/issues/229">Issue #229</a>.
</li>
<li>
COBOL: Recognize keywords that start with 'V'.
<a href="https://github.com/ScintillaOrg/lexilla/issues/230">Issue #230</a>.
</li>
<li>
COBOL: Recognize comments after tag or that start with '/'.
<a href="https://github.com/ScintillaOrg/lexilla/issues/231">Issue #231</a>.
</li>
<li>
HTML: Implement substyles for tags, attributes, and identifiers
SCE_H_TAG, SCE_H_ATTRIBUTE, SCE_HJ_WORD, SCE_HJA_WORD, SCE_HB_WORD, SCE_HP_WORD, SCE_HPHP_WORD.
</li>
<li>
HTML: Implement context-sensitive attributes. "tag.attribute" matches "attribute" only inside "tag".
</li>
<li>
HTML: Match standard handling of comments.
<a href="https://github.com/ScintillaOrg/lexilla/issues/232">Issue #232</a>.
</li>
<li>
Lua: Implement substyles for identifiers SCE_LUA_IDENTIFIER.
</li>
<li>
Ruby: Allow non-ASCII here-doc delimiters.
<a href="https://github.com/ScintillaOrg/lexilla/issues/234">Issue #234</a>.
</li>
<li>
Ruby: Allow modifier if, unless, while and until after heredoc delimiter.
<a href="https://github.com/ScintillaOrg/lexilla/issues/236">Issue #236</a>.
</li>
<li>
Rust: Recognize raw identifiers.
<a href="https://github.com/ScintillaOrg/lexilla/issues/239">Issue #239</a>,
<a href="https://github.com/ScintillaOrg/lexilla/pull/240">Pull request #240</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla531.zip">Release 5.3.1</a>
</h3>
Expand Down Expand Up @@ -12774,7 +12842,7 @@ <h3>
Pascal lexer handles comments more correctly.
</li>
<li>
C/C++/Java/JavaScipt lexer has a state for line doc comments.
C/C++/Java/JavaScript lexer has a state for line doc comments.
</li>
<li>
Error output lexer understands Sun CC messages.
Expand Down
18 changes: 13 additions & 5 deletions lexilla/examples/SimpleLexer/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

INCLUDES = -I ../../../scintilla/include -I ../../include -I ../../lexlib

BASE_FLAGS += --std=c++17 -shared
BASE_FLAGS += --std=c++17

ifdef windir
SHAREDEXTENSION = dll
else
ifeq ($(shell uname),Darwin)
SHAREDEXTENSION = dylib
BASE_FLAGS += -dynamiclib -arch arm64 -arch x86_64
BASE_FLAGS += -arch arm64 -arch x86_64
LINK_FLAGS += -dynamiclib
else
BASE_FLAGS += -fPIC
SHAREDEXTENSION = so
Expand All @@ -23,7 +24,14 @@ ifdef windir
endif

LIBRARY = SimpleLexer.$(SHAREDEXTENSION)
LEXLIB = ../../lexlib/*.cxx

vpath %.cxx ../../lexlib

LEXLIB_SOURCES := $(sort $(notdir $(wildcard ../../lexlib/*.cxx)))
LEXLIB = $(LEXLIB_SOURCES:.cxx=.o)

%.o: %.cxx
$(CXX) $(INCLUDES) $(BASE_FLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@

all: $(LIBRARY)

Expand All @@ -34,5 +42,5 @@ check: $(LIBRARY)
clean:
$(RM) *.o *obj *.lib *.exp $(LIBRARY)

$(LIBRARY): *.cxx
$(CXX) $(INCLUDES) $(BASE_FLAGS) $(CPPFLAGS) $(CXXFLAGS) $^ $(LEXLIB) $(LIBS) $(LDLIBS) -o $@
$(LIBRARY): $(LEXLIB) *.cxx
$(CXX) $(INCLUDES) $(LINK_FLAGS) $(BASE_FLAGS) -shared $(CPPFLAGS) $(CXXFLAGS) $^ $(LIBS) $(LDLIBS) -o $@
5 changes: 2 additions & 3 deletions lexilla/lexers/LexBash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,11 @@ class LexerBash final : public DefaultLexer {
OptionSetBash osBash;
CharacterSet setParamStart;
enum { ssIdentifier, ssScalar };
SubStyles subStyles;
SubStyles subStyles{styleSubable};
public:
LexerBash() :
DefaultLexer("bash", SCLEX_BASH, lexicalClasses, std::size(lexicalClasses)),
setParamStart(CharacterSet::setAlphaNum, "_" BASH_SPECIAL_PARAMETER),
subStyles(styleSubable, 0x80, 0x40, 0) {
setParamStart(CharacterSet::setAlphaNum, "_" BASH_SPECIAL_PARAMETER) {
cmdDelimiter.Set("| || |& & && ; ;; ( ) { }");
bashStruct.Set("if elif fi while until else then do done esac eval");
bashStruct_in.Set("for case select");
Expand Down
32 changes: 13 additions & 19 deletions lexilla/lexers/LexBatch.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ constexpr bool IsBSeparator(char ch) noexcept {
}

// Tests for escape character
bool IsEscaped(const char* wordStr, Sci_PositionU pos) noexcept {
constexpr bool IsEscaped(const char* wordStr, Sci_PositionU pos) noexcept {
bool isQoted=false;
while (pos>0){
pos--;
Expand All @@ -71,30 +71,24 @@ bool IsEscaped(const char* wordStr, Sci_PositionU pos) noexcept {
return isQoted;
}

// Tests for quote character
bool textQuoted(const char *lineBuffer, Sci_PositionU endPos) {
char strBuffer[1024];
strncpy(strBuffer, lineBuffer, endPos);
strBuffer[endPos] = '\0';
constexpr bool IsQuotedBy(std::string_view svBuffer, char quote) noexcept {
bool CurrentStatus = false;
const char strQuotes[] = "\"'";
const size_t strLength = strlen(strQuotes);
for (size_t i = 0; i < strLength; i++) {
const char *pQuote = strchr(strBuffer, strQuotes[i]);
while (pQuote)
{
if (!IsEscaped(strBuffer, pQuote - strBuffer)) {
CurrentStatus = !CurrentStatus;
}
pQuote = strchr(pQuote + 1, strQuotes[i]);
}
if (CurrentStatus) {
break;
size_t pQuote = svBuffer.find(quote);
while (pQuote != std::string_view::npos) {
if (!IsEscaped(svBuffer.data(), pQuote)) {
CurrentStatus = !CurrentStatus;
}
pQuote = svBuffer.find(quote, pQuote + 1);
}
return CurrentStatus;
}

// Tests for quote character
constexpr bool textQuoted(const char *lineBuffer, Sci_PositionU endPos) noexcept {
const std::string_view svBuffer(lineBuffer, endPos);
return IsQuotedBy(svBuffer, '\"') || IsQuotedBy(svBuffer, '\'');
}

void ColouriseBatchDoc(
Sci_PositionU startPos,
Sci_Position length,
Expand Down
Loading

0 comments on commit 1bfcc1a

Please sign in to comment.