Skip to content

Commit

Permalink
Update Lexilla to v5.2.7
Browse files Browse the repository at this point in the history
Closes #456
  • Loading branch information
dail8859 committed Oct 17, 2023
1 parent 6e14a9b commit 2c9de22
Show file tree
Hide file tree
Showing 117 changed files with 3,153 additions and 805 deletions.
94 changes: 94 additions & 0 deletions scripts/GenerateEnums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import sys
import os
import getopt
import pathlib

scintillaDirectory = "../src/scintilla"
scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
sys.path.append(scintillaScriptsDirectory)

import Face
import FileGenerator
import HFacer

namespace = ""

deadValues = [
"INDIC_CONTAINER",
"INDIC_IME",
"INDIC_IME_MAX",
"INDIC_MAX",
]

def HMessages(f):
out = ["enum class Message {"]
for name in f.order:
v = f.features[name]
if v["Category"] != "Deprecated":
if v["FeatureType"] in ["fun", "get", "set"]:
out.append(" " + name + " = " + v["Value"] + ",")
out.append("};")
out.append("Q_ENUM(Message);")

return out

def HEnumerations(f):
out = []
for name in f.order:
v = f.features[name]
if v["Category"] != "Deprecated":
# Only want non-deprecated enumerations and lexers are not part of Scintilla API
if v["FeatureType"] in ["enu"] and name != "Lexer":
out.append("")
prefixes = v["Value"].split()
out.append("enum class " + name + " {")
for valueName in f.order:
prefixMatched = ""
for p in prefixes:
if valueName.startswith(p) and valueName not in deadValues:
prefixMatched = p
if prefixMatched:
vEnum = f.features[valueName]
valueNameNoPrefix = ""
if valueName in f.aliases:
valueNameNoPrefix = f.aliases[valueName]
else:
valueNameNoPrefix = valueName[len(prefixMatched):]
if not valueNameNoPrefix: # Removed whole name
valueNameNoPrefix = valueName
if valueNameNoPrefix.startswith("SC_"):
valueNameNoPrefix = valueNameNoPrefix[len("SC_"):]
pascalName = Face.PascalCase(valueNameNoPrefix)
out.append(" " + pascalName + " = " + vEnum["Value"] + ",")
out.append("};")
out.append(f"Q_ENUM({name});")

out.append("\t")
out.append("\tenum class Notification {")
for name in f.order:
v = f.features[name]
if v["Category"] != "Deprecated":
if v["FeatureType"] in ["evt"]:
out.append("\t\t" + name + " = " + v["Value"] + ",")
out.append("\t};")
out.append(f"\tQ_ENUM(Notification);")
return out


def RegenerateAll(root):
HFacer.RegenerateAll(root / "src/scintilla/", False)

f = Face.Face()
f.ReadFromFile(root / "src/scintilla/include/Scintilla.iface")
FileGenerator.Regenerate(root / "src/NotepadNext/ScintillaEnums.h", "/* ", HMessages(f) + HEnumerations(f))

#FileGenerator.Regenerate(include / "ScintillaMessages.h", "//", HMessages(f))
# FileGenerator.Regenerate(include / "ScintillaTypes.h", "//", HEnumerations(f), HConstants(f))
# FileGenerator.Regenerate(include / "ScintillaCall.h", "//", HMethods(f))
# FileGenerator.Regenerate(root / "call" / "ScintillaCall.cxx", "//", CXXMethods(f))

if __name__ == "__main__":
print(pathlib.Path(__file__).resolve().parent.parent)
RegenerateAll(pathlib.Path(__file__).resolve().parent.parent)

#GenerateFile("ScintillaEdit.h.template", "ScintillaEdit.h", "/* ", True, printHFile(f))
3 changes: 3 additions & 0 deletions src/lexilla/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
**.html text
**.bat text
**.bsh text
**.zsh text
**.mak text
**.def text
**.manifest text
Expand All @@ -25,6 +26,7 @@
**.folded text
**.adoc text
**.asp text
**.aspx text
**.php text
**.vb text
**.cmake text
Expand Down Expand Up @@ -55,6 +57,7 @@
**.mms text
**.tex text
**.fs text
**.vh text
**.vhd text
**.x12 text
**.yaml text
Expand Down
116 changes: 76 additions & 40 deletions src/lexilla/cppcheck.suppress
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// File to suppress cppcheck warnings for files that will not be fixed.
// Does not suppress warnings where an additional occurrence of the warning may be of interest.
// Configured for cppcheck 2.11

// Coding style is to use assignments in constructor when there are many
// members to initialize or the initialization is complex or has comments.
Expand All @@ -17,103 +18,141 @@ noExplicitConstructor
// code legibility.
passedByValue

// cppcheck 2.11 can't find system headers on Win32.
missingIncludeSystem

// 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
checkLevelNormal:lexilla/lexers/LexCPP.cxx
checkLevelNormal:lexilla/lexers/LexHTML.cxx
checkLevelNormal:lexilla/lexers/LexPerl.cxx
checkLevelNormal:lexilla/lexers/LexRuby.cxx

// Cppcheck wrongly assumes string_view::remove_prefix can not empty the view
knownConditionTrueFalse:lexilla/test/TestLexers.cxx

// Suppress most lexer warnings since the lexers are maintained by others
redundantCondition:lexilla/lexers/LexA68k.cxx
constParameter:lexilla/lexers/LexAbaqus.cxx
constParameterReference:lexilla/lexers/LexAbaqus.cxx
constParameterReference:lexilla/lexers/LexAsciidoc.cxx
constParameterCallback:lexilla/lexers/LexAsn1.cxx
knownConditionTrueFalse:lexilla/lexers/LexAU3.cxx
shadowVariable:lexilla/lexers/LexAU3.cxx
constParameter:lexilla/lexers/LexBaan.cxx
constParameterReference:lexilla/lexers/LexBaan.cxx
unreadVariable:lexilla/lexers/LexBaan.cxx
constParameter:lexilla/lexers/LexBash.cxx
variableScope:lexilla/lexers/LexBaan.cxx
constParameterPointer:lexilla/lexers/LexBaan.cxx
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
constParameter:lexilla/lexers/LexCLW.cxx
constParameterReference:lexilla/lexers/LexCLW.cxx
knownConditionTrueFalse:lexilla/lexers/LexCLW.cxx
constParameter:lexilla/lexers/LexCoffeeScript.cxx
constParameterReference:lexilla/lexers/LexCoffeeScript.cxx
constParameterPointer:lexilla/lexers/LexCoffeeScript.cxx
knownConditionTrueFalse:lexilla/lexers/LexCoffeeScript.cxx
constParameter:lexilla/lexers/LexCPP.cxx
constParameterReference:lexilla/lexers/LexCPP.cxx
variableScope:lexilla/lexers/LexCSS.cxx
variableScope:lexilla/lexers/LexDataflex.cxx
knownConditionTrueFalse:lexilla/lexers/LexECL.cxx
variableScope:lexilla/lexers/LexECL.cxx
constParameterPointer:lexilla/lexers/LexEDIFACT.cxx
knownConditionTrueFalse:lexilla/lexers/LexEiffel.cxx
variableScope:lexilla/lexers/LexErlang.cxx
knownConditionTrueFalse:lexilla/lexers/LexErrorList.cxx
knownConditionTrueFalse:lexilla/lexers/LexEScript.cxx
constParameter:lexilla/lexers/LexFortran.cxx
constParameterReference:lexilla/lexers/LexFortran.cxx
redundantContinue:lexilla/lexers/LexFortran.cxx
knownConditionTrueFalse:lexilla/lexers/LexFSharp.cxx
constParameter:lexilla/lexers/LexGDScript.cxx
constParameterReference:lexilla/lexers/LexGDScript.cxx
variableScope:lexilla/lexers/LexGui4Cli.cxx
constParameter:lexilla/lexers/LexHaskell.cxx
constParameter:lexilla/lexers/LexHex.cxx
constParameterReference:lexilla/lexers/LexHaskell.cxx
constParameterReference:lexilla/lexers/LexHex.cxx
knownConditionTrueFalse:lexilla/lexers/LexHex.cxx
constParameter:lexilla/lexers/LexHTML.cxx
constParameterReference:lexilla/lexers/LexHTML.cxx
constVariable:lexilla/lexers/LexHollywood.cxx
variableScope:lexilla/lexers/LexInno.cxx
constParameter:lexilla/lexers/LexJulia.cxx
constParameterReference:lexilla/lexers/LexJulia.cxx
knownConditionTrueFalse:lexilla/lexers/LexJulia.cxx
unreadVariable:lexilla/lexers/LexJulia.cxx
variableScope:lexilla/lexers/LexJulia.cxx
variableScope:lexilla/lexers/LexLaTeX.cxx
constParameter:lexilla/lexers/LexLaTeX.cxx
constParameter:lexilla/lexers/LexMagik.cxx
constParameter:lexilla/lexers/LexMatlab.cxx
constParameterReference:lexilla/lexers/LexLaTeX.cxx
constParameterReference:lexilla/lexers/LexMagik.cxx
constParameterReference:lexilla/lexers/LexMarkdown.cxx
constParameterReference:lexilla/lexers/LexMatlab.cxx
unreadVariable:lexilla/lexers/LexMatlab.cxx
variableScope:lexilla/lexers/LexMatlab.cxx
variableScope:lexilla/lexers/LexMetapost.cxx
constParameter:lexilla/lexers/LexModula.cxx
constParameterReference:lexilla/lexers/LexModula.cxx
variableScope:lexilla/lexers/LexModula.cxx
constParameterReference:lexilla/lexers/LexMPT.cxx
variableScope:lexilla/lexers/LexMSSQL.cxx
shadowArgument:lexilla/lexers/LexMySQL.cxx
constParameter:lexilla/lexers/LexNim.cxx
constParameter:lexilla/lexers/LexNimrod.cxx
constParameterReference:lexilla/lexers/LexNim.cxx
constParameterReference:lexilla/lexers/LexNimrod.cxx
knownConditionTrueFalse:lexilla/lexers/LexNimrod.cxx
variableScope:lexilla/lexers/LexNimrod.cxx
variableScope:lexilla/lexers/LexNsis.cxx
knownConditionTrueFalse:lexilla/lexers/LexNsis.cxx
variableScope:lexilla/lexers/LexOpal.cxx
constParameter:lexilla/lexers/LexOScript.cxx
knownConditionTrueFalse:lexilla/lexers/LexOpal.cxx
constParameterReference:lexilla/lexers/LexOScript.cxx
variableScope:lexilla/lexers/LexPB.cxx
constParameter:lexilla/lexers/LexPerl.cxx
constParameterReference:lexilla/lexers/LexPerl.cxx
knownConditionTrueFalse:lexilla/lexers/LexPerl.cxx
constParameter:lexilla/lexers/LexPython.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
constParameter:lexilla/lexers/LexRaku.cxx
constParameterReference:lexilla/lexers/LexRaku.cxx
variableScope:lexilla/lexers/LexRaku.cxx
redundantInitialization:lexilla/lexers/LexRegistry.cxx
constParameter:lexilla/lexers/LexRuby.cxx
knownConditionTrueFalse:lexilla/lexers/LexRuby.cxx
constParameter:lexilla/lexers/LexRust.cxx
constParameterReference:lexilla/lexers/LexRuby.cxx
constParameterReference:lexilla/lexers/LexRust.cxx
knownConditionTrueFalse:lexilla/lexers/LexScriptol.cxx
variableScope:lexilla/lexers/LexSpecman.cxx
unreadVariable:lexilla/lexers/LexSpice.cxx
constParameter:lexilla/lexers/LexSTTXT.cxx
constParameterReference:lexilla/lexers/LexSTTXT.cxx
knownConditionTrueFalse:lexilla/lexers/LexTACL.cxx
clarifyCalculation:lexilla/lexers/LexTADS3.cxx
constParameter:lexilla/lexers/LexTADS3.cxx
constParameterReference:lexilla/lexers/LexTADS3.cxx
unreadVariable:lexilla/lexers/LexTCL.cxx
invalidscanf:lexilla/lexers/LexTCMD.cxx
constParameter:lexilla/lexers/LexTeX.cxx
constParameterPointer:lexilla/lexers/LexTCMD.cxx
constParameterReference:lexilla/lexers/LexTeX.cxx
variableScope:lexilla/lexers/LexTeX.cxx
knownConditionTrueFalse:lexilla/lexers/LexTxt2tags.cxx
knownConditionTrueFalse:lexilla/lexers/LexVB.cxx
constParameter:lexilla/lexers/LexVerilog.cxx
constParameterReference:lexilla/lexers/LexVerilog.cxx
variableScope:lexilla/lexers/LexVerilog.cxx
badBitmaskCheck:lexilla/lexers/LexVerilog.cxx
uselessCallsSubstr:lexilla/lexers/LexVerilog.cxx
constParameter:lexilla/lexers/LexVHDL.cxx
constParameterReference:lexilla/lexers/LexVHDL.cxx
constVariable:lexilla/lexers/LexVHDL.cxx
shadowVariable:lexilla/lexers/LexVHDL.cxx
unreadVariable:lexilla/lexers/LexVHDL.cxx
variableScope:lexilla/lexers/LexVHDL.cxx
unreadVariable:lexilla/lexers/LexVisualProlog.cxx
variableScope:lexilla/lexers/LexVisualProlog.cxx
shiftTooManyBitsSigned:lexilla/lexers/LexVisualProlog.cxx
unreadVariable:lexilla/lexers/LexX12.cxx
constVariable:lexilla/lexers/LexX12.cxx
constVariableReference:lexilla/lexers/LexX12.cxx
constParameterPointer:lexilla/lexers/LexX12.cxx
uselessCallsSubstr:lexilla/lexers/LexX12.cxx
constParameter:lexilla/lexers/LexYAML.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 All @@ -124,15 +163,12 @@ constParameterCallback:lexilla/lexers/LexPython.cxx
constParameterCallback:lexilla/lexers/LexScriptol.cxx
constParameterCallback:lexilla/lexers/LexVB.cxx

constVariable:lexilla/lexers/LexCSS.cxx
constVariable:lexilla/lexers/LexCrontab.cxx
constVariable:lexilla/lexers/LexGui4Cli.cxx
constVariable:lexilla/lexers/LexKix.cxx
constVariable:lexilla/lexers/LexMetapost.cxx
constVariable:lexilla/lexers/LexOpal.cxx

// cppcheck appears wrong as atKeyPath must be remembered between loops
variableScope:lexilla/lexers/LexRegistry.cxx
constVariableReference:lexilla/lexers/LexCSS.cxx
constVariableReference:lexilla/lexers/LexCrontab.cxx
constVariableReference:lexilla/lexers/LexGui4Cli.cxx
constVariableReference:lexilla/lexers/LexKix.cxx
constVariableReference:lexilla/lexers/LexMetapost.cxx
constVariableReference:lexilla/lexers/LexOpal.cxx

// Suppress everything in test example files
*:lexilla/test/examples/*
Expand Down
11 changes: 5 additions & 6 deletions src/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="20230531" />
<meta name="Date.Modified" content="20230922" />
<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.2.5<br />
Site last modified May 31 2023</font>
<font color="#FFCC99" size="3">Release version 5.2.7<br />
Site last modified September 22 2023</font>
</td>
<td width="20%">
&nbsp;
Expand All @@ -77,12 +77,11 @@
</tr>
</table>
<ul id="versionlist">
<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>
<li>Version 5.2.5 improves Bash, Batch, F#, and VB.</li>
<li>Version 5.2.4 improves C++ and GDScript.</li>
<li>Version 5.2.3 improves Makefile, Ruby, and YAML.</li>
<li>Version 5.2.2 improves C++, Matlab, Modula-3, Python, and X12.</li>
<li>Version 5.2.1 improves Batch, F#, Markdown, and PowerShell.</li>
<li>Version 5.2.0 improves PowerShell and R.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
Expand Down
Loading

0 comments on commit 2c9de22

Please sign in to comment.