Skip to content
Merged
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
3 changes: 2 additions & 1 deletion lexilla/cppcheck.suppress
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ knownConditionTrueFalse:lexilla/lexers/LexFSharp.cxx
variableScope:lexilla/lexers/LexFSharp.cxx
constParameterReference:lexilla/lexers/LexGAP.cxx
constParameterReference:lexilla/lexers/LexGDScript.cxx
knownConditionTrueFalse:lexilla/lexers/LexGDScript.cxx
variableScope:lexilla/lexers/LexGui4Cli.cxx
constParameterReference:lexilla/lexers/LexHaskell.cxx
constParameterReference:lexilla/lexers/LexHex.cxx
Expand Down Expand Up @@ -148,13 +149,13 @@ 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
functionStatic:lexilla/lexers/LexPerl.cxx
constParameterReference:lexilla/lexers/LexPLM.cxx
constParameterReference:lexilla/lexers/LexPO.cxx
variableScope:lexilla/lexers/LexPO.cxx
constVariablePointer:lexilla/lexers/LexPOV.cxx
constParameterReference:lexilla/lexers/LexPython.cxx
knownConditionTrueFalse:lexilla/lexers/LexPython.cxx
shadowVariable:lexilla/lexers/LexPowerPro.cxx
knownConditionTrueFalse:lexilla/lexers/LexPowerPro.cxx
variableScope:lexilla/lexers/LexProgress.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="20260812" />
<meta name="Date.Modified" content="20260928" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.logo {
Expand Down Expand Up @@ -62,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.5.3<br />
Site last modified August 12 2026</font>
<font color="#FFCC99" size="3">Release version 5.5.4<br />
Site last modified September 28 2026</font>
</td>
<td width="20%">
&nbsp;
Expand All @@ -78,11 +78,11 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 5.5.4 improves JavaScript and YAML</li>
<li>Version 5.5.3 improves Progress ABL.</li>
<li>Version 5.5.2 improves JavaScript.</li>
<li>Version 5.5.1 improves Baan, HTML, and XML.</li>
<li>Version 5.5.0 improves Fortran and LaTeX.</li>
<li>Version 5.4.9 improves Assembler, C++, F#, LaTeX, Pascal, and Ruby.</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/lexilla553.zip">
<font size="4"> <a href="https://www.scintilla.org/lexilla554.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/lexilla553.tgz">
<a href="https://www.scintilla.org/lexilla554.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
Expand All @@ -42,16 +42,16 @@ <h2>
containing very few restrictions.
</p>
<h3>
Release 5.5.3
Release 5.5.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/lexilla553.zip">zip format</a> (1.5M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla553.tgz">tgz format</a> (1.1M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/lexilla554.zip">zip format</a> (1.5M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla554.tgz">tgz format</a> (1.1M) 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
29 changes: 29 additions & 0 deletions lexilla/doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,35 @@ <h2>Contributors</h2>
</tr>
</table>
<h2 id="Releases">Releases</h2>
<h3>
<a href="https://www.scintilla.org/lexilla555.zip">Release 5.5.5</a>
</h3>
<ul>
<li>
Released 28 September 2026.
</li>
<li>
Markdown: Recognize 'front matter' key-value metadata at file start specified in YAML, TOML or JSON.
<a href="https://github.com/ScintillaOrg/lexilla/issues/59">Issue #59</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla554.zip">Release 5.5.4</a>
</h3>
<ul>
<li>
Released 28 September 2026.
</li>
<li>
JavaScript: Option lexer.cpp.continuation.only.in.strings to choose JavaScript behaviour where
line continuation only occurs inside string literals.
<a href="https://github.com/ScintillaOrg/lexilla/issues/55">Issue #55</a>.
</li>
<li>
YAML: Fix empty lines terminating text blocks.
<a href="https://github.com/ScintillaOrg/lexilla/issues/326">Issue #326</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla553.zip">Release 5.5.3</a>
</h3>
Expand Down
4 changes: 3 additions & 1 deletion lexilla/include/LexicalStyles.iface
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,9 @@ val SCE_MARKDOWN_LINK=18
val SCE_MARKDOWN_CODE=19
val SCE_MARKDOWN_CODE2=20
val SCE_MARKDOWN_CODEBK=21
val SCE_MARKDOWN_HDRTEXT=22
val SCE_MARKDOWN_FRONT_MARK=22
val SCE_MARKDOWN_FRONT=23
val SCE_MARKDOWN_FRONT_KEY=24
# Lexical state for SCLEX_TXT2TAGS
lex Txt2tags=SCLEX_TXT2TAGS SCE_TXT2TAGS_
val SCE_TXT2TAGS_DEFAULT=0
Expand Down
4 changes: 3 additions & 1 deletion lexilla/include/SciLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,9 @@
#define SCE_MARKDOWN_CODE 19
#define SCE_MARKDOWN_CODE2 20
#define SCE_MARKDOWN_CODEBK 21
#define SCE_MARKDOWN_HDRTEXT 22
#define SCE_MARKDOWN_FRONT_MARK 22
#define SCE_MARKDOWN_FRONT 23
#define SCE_MARKDOWN_FRONT_KEY 24
#define SCE_TXT2TAGS_DEFAULT 0
#define SCE_TXT2TAGS_LINE_BEGIN 1
#define SCE_TXT2TAGS_STRONG1 2
Expand Down
47 changes: 33 additions & 14 deletions lexilla/lexers/LexCPP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,16 @@ class EscapeSequence {
digitsLeft = 0;
outerState = state;
escapeSetValid = &setNoneNumeric;
constexpr int lengthU = 9;
constexpr int lengthxu = 5;
if (nextChar == 'U') {
digitsLeft = 9;
digitsLeft = lengthU;
escapeSetValid = &setHexDigits;
} else if (nextChar == 'u') {
digitsLeft = 5;
digitsLeft = lengthxu;
escapeSetValid = &setHexDigits;
} else if (nextChar == 'x') {
digitsLeft = 5;
digitsLeft = lengthxu;
escapeSetValid = &setHexDigits;
} else if (setOctDigits.Contains(nextChar)) {
digitsLeft = 3;
Expand Down Expand Up @@ -236,6 +238,10 @@ constexpr bool IsStreamCommentStyle(int style) noexcept {
style == SCE_C_COMMENTDOCKEYWORDERROR;
}

constexpr bool IsStringStyle(int style) noexcept {
return AnyOf(style, SCE_C_STRING, SCE_C_CHARACTER, SCE_C_STRINGRAW);
}

struct PPDefinition {
Sci_Position line;
std::string key;
Expand Down Expand Up @@ -407,6 +413,7 @@ struct OptionsCPP {
bool hashquotedStrings = false;
BackQuotedString backQuotedStrings = BackQuotedString::None;
bool escapeSequence = false;
bool continuationOnlyStrings = false;
bool fold = false;
bool foldSyntaxBased = true;
bool foldComment = false;
Expand Down Expand Up @@ -471,6 +478,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
DefineProperty("lexer.cpp.escape.sequence", &OptionsCPP::escapeSequence,
"Set to 1 to enable highlighting of escape sequences in strings");

DefineProperty("lexer.cpp.continuation.only.in.strings", &OptionsCPP::continuationOnlyStrings,
"Set to 1 to only handle line continuation inside string literals");

DefineProperty("fold", &OptionsCPP::fold);

DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased,
Expand Down Expand Up @@ -688,7 +698,7 @@ class LexerCPP : public ILexer5 {
const int firstSubStyle = subStyles.FirstAllocated();
if (firstSubStyle >= 0) {
const int lastSubStyle = subStyles.LastAllocated();
if (((style >= firstSubStyle) && (style <= (lastSubStyle))) ||
if (((style >= firstSubStyle) && (style <= lastSubStyle)) ||
((style >= firstSubStyle + inactiveFlag) && (style <= (lastSubStyle + inactiveFlag)))) {
int styleActive = style;
if (style > lastSubStyle) {
Expand Down Expand Up @@ -855,14 +865,17 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
}
}

if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) ||
(MaskActive(initStyle) == SCE_C_COMMENTLINE) ||
(MaskActive(initStyle) == SCE_C_COMMENTLINEDOC)) {
if (AnyOf(MaskActive(initStyle), SCE_C_PREPROCESSOR, SCE_C_COMMENTLINE, SCE_C_COMMENTLINEDOC)) {
// Set continuationLine if last character of previous line is '\'
if (lineCurrent > 0) {
const Sci_Position endLinePrevious = styler.LineEnd(lineCurrent - 1);
if (endLinePrevious > 0) {
continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\';
const Sci_Position lastOfLinePrevious = styler.LineEnd(lineCurrent - 1) - 1;
if (lastOfLinePrevious >= 0) {
if (styler.SafeGetCharAt(lastOfLinePrevious) == '\\') {
if (!options.continuationOnlyStrings ||
IsStringStyle(styler.StyleAt(lastOfLinePrevious))) {
continuationLine = true;
}
}
}
}
}
Expand Down Expand Up @@ -959,13 +972,16 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
}

// Handle line continuation generically.
if (sc.ch == '\\') {
if ((sc.currentPos+1) >= lineEndNext) {
if ((sc.ch == '\\') && ((sc.currentPos+1) >= lineEndNext)) {
if (!options.continuationOnlyStrings || IsStringStyle(sc.state)) {
// Handle line continuation when option disabled or inside string literals
// For C++, all \ at line end are continuations but,
// for JavaScript, \ is only a continuation inside string literals.
lineCurrent++;
lineEndNext = styler.LineEnd(lineCurrent);
vlls.Add(lineCurrent, preproc);
if (!rawStringTerminator.empty()) {
rawSTNew.Set(lineCurrent-1, rawStringTerminator);
rawSTNew.Set(lineCurrent - 1, rawStringTerminator);
}
sc.Forward();
if (sc.ch == '\r' && sc.chNext == '\n') {
Expand Down Expand Up @@ -1294,6 +1310,9 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
sc.SetState(styleBeforeTaskMarker|activitySet);
styleBeforeTaskMarker = SCE_C_DEFAULT;
}
break;
default:
break;
}

if (sc.atLineEnd && !atLineEndBeforeSwitch) {
Expand Down Expand Up @@ -1629,7 +1648,7 @@ void SCI_METHOD LexerCPP::Fold(Sci_PositionU startPos, Sci_Position length, int
lineStartNext = styler.LineStart(lineCurrent+1);
levelCurrent = levelNext;
levelMinCurrent = levelCurrent;
if (atEOL && (i == static_cast<Sci_PositionU>(styler.Length()-1))) {
if (atEOL && ((i+1) == static_cast<Sci_PositionU>(styler.Length()))) {
// There is an empty line at end of file so give it same level and empty
styler.SetLevel(lineCurrent, FoldLevelForCurrent(levelCurrent) | SC_FOLDLEVELWHITEFLAG);
}
Expand Down
10 changes: 4 additions & 6 deletions lexilla/lexers/LexHTML.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,9 @@ Sci_Position FindPhpStringDelimiter(std::string &phpStringDelimiter, Sci_Positio
isQuoted = false;
j++;
break;
} else {
phpStringDelimiter.clear();
return beginning;
}
phpStringDelimiter.clear();
return beginning;
}
phpStringDelimiter.push_back(styler[j]);
}
Expand Down Expand Up @@ -1083,8 +1082,7 @@ class LexerHTML : public DefaultLexer {
osHTML(isPHPScript_),
nonFoldingTags(std::begin(tagsThatDoNotFold), std::end(tagsThatDoNotFold)) {
}
~LexerHTML() override {
}
~LexerHTML() override = default;
void SCI_METHOD Release() override {
delete this;
}
Expand Down Expand Up @@ -1787,7 +1785,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int

// handle the end of a pre-processor = Non-HTML
else if ((!isMako && !isDjango && ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) &&
(((scriptLanguage != eScriptNone) && stateAllowsTermination(state))) &&
((scriptLanguage != eScriptNone) && stateAllowsTermination(state)) &&
((chNext == '>') && isPreProcessorEndTag(state, ch))) ||
((scriptLanguage == eScriptSGML) && (ch == '>') && !AnyOf(state, SCE_H_SGML_COMMENT, SCE_H_SGML_DOUBLESTRING, SCE_H_SGML_SIMPLESTRING))) {
if (state == SCE_H_ASPAT) {
Expand Down
Loading
Loading