Update Lexilla to v5.4.1, replace Zufiliu's Dart lexer by new Lexilla's Dart lexer (based on Zufuliu's Dart lexer)

This commit is contained in:
METANEOCORTEX\Kotti 2024-11-30 11:33:15 +01:00
parent ec3af4c348
commit 205ee4c3d4
31 changed files with 600 additions and 1161 deletions

View File

@ -55,6 +55,7 @@
<ClCompile Include="lexers\LexCPP.cxx" />
<ClCompile Include="lexers\LexCSS.cxx" />
<ClCompile Include="lexers\LexD.cxx" />
<ClCompile Include="lexers\LexDart.cxx" />
<ClCompile Include="lexers\LexDiff.cxx" />
<ClCompile Include="lexers\LexFortran.cxx" />
<ClCompile Include="lexers\LexHTML.cxx" />
@ -86,7 +87,6 @@
<ClCompile Include="lexers\LexYAML.cxx" />
<ClCompile Include="lexers_x\LexAHK.cxx" />
<ClCompile Include="lexers_x\LexCSV.cxx" />
<ClCompile Include="lexers_x\LexDart.cxx" />
<ClCompile Include="lexers_x\LexerUtils.cxx" />
<ClCompile Include="lexers_x\LexJSON.cxx" />
<ClCompile Include="lexers_x\LexKotlin.cxx" />

View File

@ -206,9 +206,6 @@
<ClCompile Include="lexers_x\LexCSV.cxx">
<Filter>lexers_x</Filter>
</ClCompile>
<ClCompile Include="lexers_x\LexDart.cxx">
<Filter>lexers_x</Filter>
</ClCompile>
<ClCompile Include="lexers_x\LexKotlin.cxx">
<Filter>lexers_x</Filter>
</ClCompile>
@ -278,6 +275,9 @@
<ClCompile Include="lexers\LexTOML.cxx">
<Filter>lexers</Filter>
</ClCompile>
<ClCompile Include="lexers\LexDart.cxx">
<Filter>lexers</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="src\LexillaVersion.rc">

View File

@ -1,6 +1,12 @@
// 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.12
// Configured for cppcheck 2.15
// Just a report of how many checkers are run
checkersReport
// This just warns that cppcheck isn't exhaustive and it still appears in exhaustive mode
normalCheckLevelMaxBranches
// Coding style is to use assignments in constructor when there are many
// members to initialize or the initialization is complex or has comments.
@ -28,9 +34,6 @@ missingIncludeSystem
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
// 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
@ -73,6 +76,7 @@ variableScope:lexilla/lexers/LexCSS.cxx
knownConditionTrueFalse:lexilla/lexers/LexDataflex.cxx
constParameterReference:lexilla/lexers/LexDataflex.cxx
variableScope:lexilla/lexers/LexDataflex.cxx
constParameterReference:lexilla/lexers/LexDart.cxx
knownConditionTrueFalse:lexilla/lexers/LexECL.cxx
variableScope:lexilla/lexers/LexECL.cxx
constParameter:lexilla/lexers/LexEDIFACT.cxx

View File

@ -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="20240821" />
<meta name="Date.Modified" content="20241019" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.logo {
@ -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.4.0<br />
Site last modified August 21 2024</font>
<font color="#FFCC99" size="3">Release version 5.4.1<br />
Site last modified October 19 2024</font>
</td>
<td width="20%">
&nbsp;
@ -77,11 +77,11 @@
</tr>
</table>
<ul id="versionlist">
<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>
<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>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
@ -130,7 +130,7 @@ if (!IsRemote()) { //if NOT remote...
<p>
The source code can be downloaded via Git at GitHub
<a href="https://github.com/ScintillaOrg/lexilla">Lexilla project page</a>.<br />
git clone https://github.com/ScintillaOrg/lexilla
<code>git clone https://github.com/ScintillaOrg/lexilla</code>
</p>
<p>Current repository status:<br />
<a href="https://github.com/ScintillaOrg/lexilla/actions/workflows/build-check.yml"><img src="https://github.com/ScintillaOrg/lexilla/actions/workflows/build-check.yml/badge.svg" /></a><br />

View File

@ -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/lexilla540.zip">
<font size="4"> <a href="https://www.scintilla.org/lexilla541.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/lexilla540.tgz">
<a href="https://www.scintilla.org/lexilla541.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
@ -42,7 +42,7 @@
containing very few restrictions.
</p>
<h3>
Release 5.4.0
Release 5.4.1
</h3>
<h4>
Source Code
@ -50,8 +50,8 @@
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/lexilla540.zip">zip format</a> (1.3M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla540.tgz">tgz format</a> (1.0M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/lexilla541.zip">zip format</a> (1.4M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/lexilla541.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>

View File

@ -585,20 +585,103 @@
<td>Tsuyoshi Miyake</td>
<td>Martin Schäfer</td>
<td>RainRat</td>
</tr><tr>
<td>Henrik S. Johansen</td>
<td>Ekopalypse</td>
</tr>
</table>
<h2>Releases</h2>
<h3>
<a href="https://www.scintilla.org/lexilla542.zip">Release 5.4.2</a>
</h3>
<ul>
<li>
Released 19 October 2024.
</li>
<li>
Update to Unicode 15.1.
<a href="https://github.com/ScintillaOrg/lexilla/issues/285">Issue #285</a>.
</li>
<li>
Lexer added for Nix "nix".
<a href="https://github.com/ScintillaOrg/lexilla/pull/282">Pull request #282</a>.
</li>
<li>
JavaScript: Use correct SCE_HJA_TEMPLATELITERAL style for server-side template literals in
HTML instead of client-side style.
<a href="https://github.com/ScintillaOrg/lexilla/issues/286">Issue #286</a>.
</li>
<li>
PHP: Fix unstable lexing with substyled keyword and unterminated string.
<a href="https://github.com/ScintillaOrg/lexilla/issues/288">Issue #288</a>.
</li>
<li>
Rust: Add C string and raw C string literal styles SCE_RUST_CSTRING and SCE_RUST_CSTRINGR.
<a href="https://github.com/ScintillaOrg/lexilla/pull/292">Pull request #292</a>,
<a href="https://github.com/ScintillaOrg/lexilla/issues/268">Issue #268</a>.
</li>
<li>
TOML: Don't treat keys without values as errors.
<a href="https://github.com/ScintillaOrg/lexilla/pull/283">Pull request #283</a>.
</li>
<li>
Zig: Add SCE_ZIG_IDENTIFIER_STRING for identifiers expressed as strings.
<a href="https://github.com/ScintillaOrg/lexilla/pull/287">Pull request #287</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla541.zip">Release 5.4.1</a>
</h3>
<ul>
<li>
Released 21 August 2024.
Released 19 October 2024.
</li>
<li>
Lexer added for Dart "dart".
<a href="https://github.com/ScintillaOrg/lexilla/pull/265">Pull request #265</a>,
<a href="https://github.com/ScintillaOrg/lexilla/pull/275">Pull request #275</a>.
</li>
<li>
Lexer added for troff / nroff "troff".
<a href="https://github.com/ScintillaOrg/lexilla/pull/264">Pull request #264</a>.
</li>
<li>
Lexer added for Zig "zig".
<a href="https://github.com/ScintillaOrg/lexilla/pull/267">Pull request #267</a>.
</li>
<li>
C++: Fix crash for empty documentation comment keyword where '&lt;' occurs at line end.
</li>
<li>
F#: Include EOLs in the style range of SCE_FSHARP_COMMENTLINE.
Stabilizes EOL detection when folding line comment groups.
<a href="https://github.com/ScintillaOrg/lexilla/issues/276">Issue #276</a>.
</li>
<li>
F#: Fix per-line folding in F# documents.
<a href="https://github.com/ScintillaOrg/lexilla/issues/277">Issue #277</a>.
</li>
<li>
HTML: Improve SGML/DTD lexing.
Don't terminate SGML when &gt; inside quoted string.
Lex both [ and ] as SCE_H_SGML_DEFAULT.
Nested sections handled instead of switching to SCE_H_SGML_ERROR.
<a href="https://github.com/ScintillaOrg/lexilla/issues/272">Issue #272</a>.
</li>
<li>
JavaScript: New SCE_HJ_TEMPLATELITERAL and SCE_HJA_TEMPLATELITERAL
styles for template literals when lexer is hypertext, or xml.
<a href="https://github.com/ScintillaOrg/lexilla/issues/280">Issue #280</a>.
</li>
<li>
PHP: Fix failure to recognize PHP start "&lt;?php' at end of document.
Caused by not capping retrieval range at document end causing no text to be retrieved.
<a href="https://github.com/ScintillaOrg/lexilla/issues/269">Issue #269</a>.
</li>
<li>
Smalltalk: Fix scaled decimal numbers without decimal separator.
<a href="https://github.com/ScintillaOrg/lexilla/pull/274">Pull request #274</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla540.zip">Release 5.4.0</a>

View File

@ -27,6 +27,7 @@ style.simple.1=fore:#FF0000
#include <string.h>
#include <assert.h>
#include <string>
#include <string_view>
#include "ILexer.h"

View File

@ -146,6 +146,9 @@ val SCLEX_ASCIIDOC=134
val SCLEX_GDSCRIPT=135
val SCLEX_TOML=136
val SCLEX_TROFF=137
val SCLEX_DART=138
val SCLEX_ZIG=139
val SCLEX_NIX=140
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
@ -176,12 +179,10 @@ val SCE_P_FTRIPLEDOUBLE=19
val SCE_P_ATTRIBUTE=20
# Lexical states for SCLEX_CPP
# Lexical states for SCLEX_BULLANT
# Lexical states for SCLEX_COBOL
# Lexical states for SCLEX_TACL
# Lexical states for SCLEX_TAL
lex Cpp=SCLEX_CPP SCE_C_
lex BullAnt=SCLEX_BULLANT SCE_C_
lex COBOL=SCLEX_COBOL SCE_C_
lex TACL=SCLEX_TACL SCE_C_
lex TAL=SCLEX_TAL SCE_C_
val SCE_C_DEFAULT=0
@ -212,6 +213,21 @@ val SCE_C_PREPROCESSORCOMMENTDOC=24
val SCE_C_USERLITERAL=25
val SCE_C_TASKMARKER=26
val SCE_C_ESCAPESEQUENCE=27
# Lexical states for SCLEX_COBOL
lex COBOL=SCLEX_COBOL SCE_COBOL_
val SCE_COBOL_DEFAULT=0
val SCE_COBOL_COMMENT=1
val SCE_COBOL_COMMENTLINE=2
val SCE_COBOL_COMMENTDOC=3
val SCE_COBOL_NUMBER=4
val SCE_COBOL_WORD=5
val SCE_COBOL_STRING=6
val SCE_COBOL_CHARACTER=7
val SCE_COBOL_WORD3=8
val SCE_COBOL_PREPROCESSOR=9
val SCE_COBOL_OPERATOR=10
val SCE_COBOL_IDENTIFIER=11
val SCE_COBOL_WORD2=16
# Lexical states for SCLEX_D
lex D=SCLEX_D SCE_D_
val SCE_D_DEFAULT=0
@ -314,6 +330,7 @@ val SCE_HJ_SINGLESTRING=49
val SCE_HJ_SYMBOLS=50
val SCE_HJ_STRINGEOL=51
val SCE_HJ_REGEX=52
val SCE_HJ_TEMPLATELITERAL=53
# ASP Javascript
val SCE_HJA_START=55
val SCE_HJA_DEFAULT=56
@ -328,6 +345,7 @@ val SCE_HJA_SINGLESTRING=64
val SCE_HJA_SYMBOLS=65
val SCE_HJA_STRINGEOL=66
val SCE_HJA_REGEX=67
val SCE_HJA_TEMPLATELITERAL=68
# Embedded VBScript
val SCE_HB_START=70
val SCE_HB_DEFAULT=71
@ -2006,6 +2024,8 @@ val SCE_RUST_LEXERROR=20
val SCE_RUST_BYTESTRING=21
val SCE_RUST_BYTESTRINGR=22
val SCE_RUST_BYTECHARACTER=23
val SCE_RUST_CSTRING=24
val SCE_RUST_CSTRINGR=25
# Lexical states for SCLEX_DMAP
lex DMAP=SCLEX_DMAP SCE_DMAP_
val SCE_DMAP_DEFAULT=0
@ -2360,3 +2380,70 @@ val SCE_TROFF_ESCAPE_WIDTH=24
val SCE_TROFF_ESCAPE_VSPACING=25
val SCE_TROFF_ESCAPE_DEVICE=26
val SCE_TROFF_ESCAPE_NOMOVE=27
# Lexical states for SCLEX_DART
lex Dart=SCLEX_DART SCE_DART_
val SCE_DART_DEFAULT=0
val SCE_DART_COMMENTLINE=1
val SCE_DART_COMMENTLINEDOC=2
val SCE_DART_COMMENTBLOCK=3
val SCE_DART_COMMENTBLOCKDOC=4
val SCE_DART_STRING_SQ=5
val SCE_DART_STRING_DQ=6
val SCE_DART_TRIPLE_STRING_SQ=7
val SCE_DART_TRIPLE_STRING_DQ=8
val SCE_DART_RAWSTRING_SQ=9
val SCE_DART_RAWSTRING_DQ=10
val SCE_DART_TRIPLE_RAWSTRING_SQ=11
val SCE_DART_TRIPLE_RAWSTRING_DQ=12
val SCE_DART_ESCAPECHAR=13
val SCE_DART_IDENTIFIER=14
val SCE_DART_IDENTIFIER_STRING=15
val SCE_DART_OPERATOR=16
val SCE_DART_OPERATOR_STRING=17
val SCE_DART_SYMBOL_IDENTIFIER=18
val SCE_DART_SYMBOL_OPERATOR=19
val SCE_DART_NUMBER=20
val SCE_DART_KEY=21
val SCE_DART_METADATA=22
val SCE_DART_KW_PRIMARY=23
val SCE_DART_KW_SECONDARY=24
val SCE_DART_KW_TERTIARY=25
val SCE_DART_KW_TYPE=26
# Lexical states for SCLEX_ZIG
lex Zig=SCLEX_ZIG SCE_ZIG_
val SCE_ZIG_DEFAULT=0
val SCE_ZIG_COMMENTLINE=1
val SCE_ZIG_COMMENTLINEDOC=2
val SCE_ZIG_COMMENTLINETOP=3
val SCE_ZIG_NUMBER=4
val SCE_ZIG_OPERATOR=5
val SCE_ZIG_CHARACTER=6
val SCE_ZIG_STRING=7
val SCE_ZIG_MULTISTRING=8
val SCE_ZIG_ESCAPECHAR=9
val SCE_ZIG_IDENTIFIER=10
val SCE_ZIG_FUNCTION=11
val SCE_ZIG_BUILTIN_FUNCTION=12
val SCE_ZIG_KW_PRIMARY=13
val SCE_ZIG_KW_SECONDARY=14
val SCE_ZIG_KW_TERTIARY=15
val SCE_ZIG_KW_TYPE=16
val SCE_ZIG_IDENTIFIER_STRING=17
# Lexical states for SCLEX_NIX
lex Nix=SCLEX_NIX SCE_NIX_
val SCE_NIX_DEFAULT=0
val SCE_NIX_COMMENTLINE=1
val SCE_NIX_COMMENTBLOCK=2
val SCE_NIX_STRING=3
val SCE_NIX_STRING_MULTILINE=4
val SCE_NIX_ESCAPECHAR=5
val SCE_NIX_IDENTIFIER=6
val SCE_NIX_OPERATOR=7
val SCE_NIX_OPERATOR_STRING=8
val SCE_NIX_NUMBER=9
val SCE_NIX_KEY=10
val SCE_NIX_PATH=11
val SCE_NIX_KEYWORD1=12
val SCE_NIX_KEYWORD2=13
val SCE_NIX_KEYWORD3=14
val SCE_NIX_KEYWORD4=15

View File

@ -150,6 +150,9 @@
#define SCLEX_GDSCRIPT 135
#define SCLEX_TOML 136
#define SCLEX_TROFF 137
#define SCLEX_DART 138
#define SCLEX_ZIG 139
#define SCLEX_NIX 140
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
@ -200,6 +203,19 @@
#define SCE_C_USERLITERAL 25
#define SCE_C_TASKMARKER 26
#define SCE_C_ESCAPESEQUENCE 27
#define SCE_COBOL_DEFAULT 0
#define SCE_COBOL_COMMENT 1
#define SCE_COBOL_COMMENTLINE 2
#define SCE_COBOL_COMMENTDOC 3
#define SCE_COBOL_NUMBER 4
#define SCE_COBOL_WORD 5
#define SCE_COBOL_STRING 6
#define SCE_COBOL_CHARACTER 7
#define SCE_COBOL_WORD3 8
#define SCE_COBOL_PREPROCESSOR 9
#define SCE_COBOL_OPERATOR 10
#define SCE_COBOL_IDENTIFIER 11
#define SCE_COBOL_WORD2 16
#define SCE_D_DEFAULT 0
#define SCE_D_COMMENT 1
#define SCE_D_COMMENTLINE 2
@ -290,6 +306,7 @@
#define SCE_HJ_SYMBOLS 50
#define SCE_HJ_STRINGEOL 51
#define SCE_HJ_REGEX 52
#define SCE_HJ_TEMPLATELITERAL 53
#define SCE_HJA_START 55
#define SCE_HJA_DEFAULT 56
#define SCE_HJA_COMMENT 57
@ -303,6 +320,7 @@
#define SCE_HJA_SYMBOLS 65
#define SCE_HJA_STRINGEOL 66
#define SCE_HJA_REGEX 67
#define SCE_HJA_TEMPLATELITERAL 68
#define SCE_HB_START 70
#define SCE_HB_DEFAULT 71
#define SCE_HB_COMMENTLINE 72
@ -1793,6 +1811,8 @@
#define SCE_RUST_BYTESTRING 21
#define SCE_RUST_BYTESTRINGR 22
#define SCE_RUST_BYTECHARACTER 23
#define SCE_RUST_CSTRING 24
#define SCE_RUST_CSTRINGR 25
#define SCE_DMAP_DEFAULT 0
#define SCE_DMAP_COMMENT 1
#define SCE_DMAP_NUMBER 2
@ -2104,6 +2124,67 @@
#define SCE_TROFF_ESCAPE_VSPACING 25
#define SCE_TROFF_ESCAPE_DEVICE 26
#define SCE_TROFF_ESCAPE_NOMOVE 27
#define SCE_DART_DEFAULT 0
#define SCE_DART_COMMENTLINE 1
#define SCE_DART_COMMENTLINEDOC 2
#define SCE_DART_COMMENTBLOCK 3
#define SCE_DART_COMMENTBLOCKDOC 4
#define SCE_DART_STRING_SQ 5
#define SCE_DART_STRING_DQ 6
#define SCE_DART_TRIPLE_STRING_SQ 7
#define SCE_DART_TRIPLE_STRING_DQ 8
#define SCE_DART_RAWSTRING_SQ 9
#define SCE_DART_RAWSTRING_DQ 10
#define SCE_DART_TRIPLE_RAWSTRING_SQ 11
#define SCE_DART_TRIPLE_RAWSTRING_DQ 12
#define SCE_DART_ESCAPECHAR 13
#define SCE_DART_IDENTIFIER 14
#define SCE_DART_IDENTIFIER_STRING 15
#define SCE_DART_OPERATOR 16
#define SCE_DART_OPERATOR_STRING 17
#define SCE_DART_SYMBOL_IDENTIFIER 18
#define SCE_DART_SYMBOL_OPERATOR 19
#define SCE_DART_NUMBER 20
#define SCE_DART_KEY 21
#define SCE_DART_METADATA 22
#define SCE_DART_KW_PRIMARY 23
#define SCE_DART_KW_SECONDARY 24
#define SCE_DART_KW_TERTIARY 25
#define SCE_DART_KW_TYPE 26
#define SCE_ZIG_DEFAULT 0
#define SCE_ZIG_COMMENTLINE 1
#define SCE_ZIG_COMMENTLINEDOC 2
#define SCE_ZIG_COMMENTLINETOP 3
#define SCE_ZIG_NUMBER 4
#define SCE_ZIG_OPERATOR 5
#define SCE_ZIG_CHARACTER 6
#define SCE_ZIG_STRING 7
#define SCE_ZIG_MULTISTRING 8
#define SCE_ZIG_ESCAPECHAR 9
#define SCE_ZIG_IDENTIFIER 10
#define SCE_ZIG_FUNCTION 11
#define SCE_ZIG_BUILTIN_FUNCTION 12
#define SCE_ZIG_KW_PRIMARY 13
#define SCE_ZIG_KW_SECONDARY 14
#define SCE_ZIG_KW_TERTIARY 15
#define SCE_ZIG_KW_TYPE 16
#define SCE_ZIG_IDENTIFIER_STRING 17
#define SCE_NIX_DEFAULT 0
#define SCE_NIX_COMMENTLINE 1
#define SCE_NIX_COMMENTBLOCK 2
#define SCE_NIX_STRING 3
#define SCE_NIX_STRING_MULTILINE 4
#define SCE_NIX_ESCAPECHAR 5
#define SCE_NIX_IDENTIFIER 6
#define SCE_NIX_OPERATOR 7
#define SCE_NIX_OPERATOR_STRING 8
#define SCE_NIX_NUMBER 9
#define SCE_NIX_KEY 10
#define SCE_NIX_PATH 11
#define SCE_NIX_KEYWORD1 12
#define SCE_NIX_KEYWORD2 13
#define SCE_NIX_KEYWORD3 14
#define SCE_NIX_KEYWORD4 15
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
#endif

View File

@ -1073,7 +1073,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
styleBeforeDCKeyword = SCE_C_COMMENTDOC;
sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet);
}
} else if ((sc.ch == '<' && sc.chNext != '/')
} else if ((sc.ch == '<' && !(IsASpace(sc.chNext) || sc.chNext == '/'))
|| (sc.ch == '/' && sc.chPrev == '<')) { // XML comment style
styleBeforeDCKeyword = SCE_C_COMMENTDOC;
sc.ForwardSetState(SCE_C_COMMENTDOCKEYWORD | activitySet);

View File

@ -91,7 +91,7 @@ bool Contains(const std::string &s, std::string_view search) noexcept {
return s.find(search) != std::string::npos;
}
script_type segIsScriptingIndicator(Accessor &styler, Sci_PositionU start, Sci_PositionU end, script_type prevValue) {
script_type segIsScriptingIndicator(const Accessor &styler, Sci_PositionU start, Sci_PositionU end, script_type prevValue) {
const std::string s = styler.GetRangeLowered(start, end+1);
if (Contains(s, "vbs"))
return eScriptVBS;
@ -103,13 +103,12 @@ script_type segIsScriptingIndicator(Accessor &styler, Sci_PositionU start, Sci_P
return eScriptJS;
if (Contains(s, "php"))
return eScriptPHP;
if (Contains(s, "xml")) {
const size_t xml = s.find("xml");
if (xml != std::string::npos) {
for (size_t t = 0; t < xml; t++) {
if (!IsASpace(s[t])) {
return prevValue;
}
const size_t xml = s.find("xml");
if (xml != std::string::npos) {
for (size_t t = 0; t < xml; t++) {
if (!IsASpace(s[t])) {
return prevValue;
}
}
return eScriptXML;
@ -118,13 +117,8 @@ script_type segIsScriptingIndicator(Accessor &styler, Sci_PositionU start, Sci_P
return prevValue;
}
int PrintScriptingIndicatorOffset(Accessor &styler, Sci_PositionU start, Sci_PositionU end) {
int iResult = 0;
const std::string s = styler.GetRangeLowered(start, end+1);
if (0 == strncmp(s.c_str(), "php", 3)) {
iResult = 3;
}
return iResult;
constexpr bool IsPHPScriptState(int state) noexcept {
return (state >= SCE_HPHP_DEFAULT && state <= SCE_HPHP_OPERATOR) || (state == SCE_HPHP_COMPLEX_VARIABLE);
}
script_type ScriptOfState(int state) noexcept {
@ -132,9 +126,9 @@ script_type ScriptOfState(int state) noexcept {
return eScriptPython;
} else if ((state >= SCE_HB_START && state <= SCE_HB_STRINGEOL) || (state == SCE_H_ASPAT || state == SCE_H_XCCOMMENT)) {
return eScriptVBS;
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_TEMPLATELITERAL)) {
return eScriptJS;
} else if ((state >= SCE_HPHP_DEFAULT && state <= SCE_HPHP_COMMENTLINE) || (state == SCE_HPHP_COMPLEX_VARIABLE)) {
} else if (IsPHPScriptState(state)) {
return eScriptPHP;
} else if ((state >= SCE_H_SGML_DEFAULT) && (state < SCE_H_SGML_BLOCK_DEFAULT)) {
return eScriptSGML;
@ -153,7 +147,7 @@ constexpr int statePrintForState(int state, script_mode inScriptType) noexcept {
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON);
} else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS);
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_TEMPLATELITERAL)) {
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS);
}
}
@ -168,7 +162,7 @@ constexpr int stateForPrintState(int StateToPrint) noexcept {
state = StateToPrint - SCE_HA_PYTHON;
} else if ((StateToPrint >= SCE_HBA_START) && (StateToPrint <= SCE_HBA_STRINGEOL)) {
state = StateToPrint - SCE_HA_VBS;
} else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_REGEX)) {
} else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_TEMPLATELITERAL)) {
state = StateToPrint - SCE_HA_JS;
}
@ -185,8 +179,12 @@ constexpr bool isStringState(int state) noexcept {
switch (state) {
case SCE_HJ_DOUBLESTRING:
case SCE_HJ_SINGLESTRING:
case SCE_HJ_REGEX:
case SCE_HJ_TEMPLATELITERAL:
case SCE_HJA_DOUBLESTRING:
case SCE_HJA_SINGLESTRING:
case SCE_HJA_REGEX:
case SCE_HJA_TEMPLATELITERAL:
case SCE_HB_STRING:
case SCE_HBA_STRING:
case SCE_HP_STRING:
@ -454,12 +452,12 @@ void classifyWordHTPHP(Sci_PositionU start, Sci_PositionU end, const WordList &k
styler.ColourTo(end, chAttr);
}
bool isWordHSGML(Sci_PositionU start, Sci_PositionU end, const WordList &keywords, Accessor &styler) {
bool isWordHSGML(Sci_PositionU start, Sci_PositionU end, const WordList &keywords, const Accessor &styler) {
const std::string s = styler.GetRange(start, end + 1);
return keywords.InList(s);
}
bool isWordCdata(Sci_PositionU start, Sci_PositionU end, Accessor &styler) {
bool isWordCdata(Sci_PositionU start, Sci_PositionU end, const Accessor &styler) {
const std::string s = styler.GetRange(start, end + 1);
return s == "[CDATA[";
}
@ -492,9 +490,13 @@ constexpr int StateForScript(script_type scriptLanguage) noexcept {
return Result;
}
constexpr int defaultStateForSGML(script_type scriptLanguage) noexcept {
return (scriptLanguage == eScriptSGMLblock)? SCE_H_SGML_BLOCK_DEFAULT : SCE_H_SGML_DEFAULT;
}
constexpr bool issgmlwordchar(int ch) noexcept {
return !IsASCII(ch) ||
(IsAlphaNumeric(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '[');
(IsAlphaNumeric(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#');
}
constexpr bool IsPhpWordStart(int ch) noexcept {
@ -512,15 +514,6 @@ constexpr bool InTagState(int state) noexcept {
SCE_H_DOUBLESTRING, SCE_H_SINGLESTRING);
}
constexpr bool IsCommentState(const int state) noexcept {
return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT;
}
constexpr bool IsScriptCommentState(const int state) noexcept {
return AnyOf(state, SCE_HJ_COMMENT, SCE_HJ_COMMENTLINE, SCE_HJA_COMMENT,
SCE_HJA_COMMENTLINE, SCE_HB_COMMENTLINE, SCE_HBA_COMMENTLINE);
}
constexpr bool isLineEnd(int ch) noexcept {
return ch == '\r' || ch == '\n';
}
@ -675,28 +668,41 @@ constexpr bool isPHPStringState(int state) noexcept {
(state == SCE_HPHP_COMPLEX_VARIABLE);
}
constexpr bool StyleNeedsBacktrack(int state) noexcept {
return InTagState(state) || isPHPStringState(state);
}
enum class AllowPHP : int {
None, // No PHP
PHP, // <?php and <?=
Question, // <?
};
constexpr bool IsPHPEntryState(int state) noexcept {
return !(isPHPStringState(state) || IsScriptCommentState(state) || AnyOf(state, SCE_H_ASPAT, SCE_HPHP_COMMENT, SCE_HPHP_COMMENTLINE));
}
enum class InstructionTag {
None,
XML,
Open,// <? ?> short open tag
Echo,// <?= ?> short echo tag
PHP, // <?php ?> standard tag
};
bool IsPHPStart(AllowPHP allowPHP, Accessor &styler, Sci_PositionU start) {
if (allowPHP == AllowPHP::None) {
return false;
}
if (allowPHP == AllowPHP::PHP) {
InstructionTag segIsScriptInstruction(AllowPHP allowPHP, int state, const Accessor &styler, Sci_PositionU start, bool isXml) {
constexpr std::string_view phpTag = "php";
constexpr std::string_view xmlTag = "xml";
const std::string tag = styler.GetRangeLowered(start, start + phpTag.length());
if (allowPHP != AllowPHP::None) {
// Require <?php or <?=
constexpr std::string_view phpTag = "<?php";
constexpr std::string_view echoTag = "<?=";
const std::string tag = styler.GetRangeLowered(start, start + phpTag.length());
return (tag == phpTag) || (tag.substr(0, echoTag.length()) == echoTag);
if (tag == phpTag) {
return InstructionTag::PHP;
}
if (!tag.empty() && (tag.front() == '=')) {
return InstructionTag::Echo;
}
}
return true;
if (isXml || tag == xmlTag) {
return AnyOf(state, SCE_H_DEFAULT, SCE_H_SGML_BLOCK_DEFAULT)? InstructionTag::XML : InstructionTag::None;
}
return (allowPHP == AllowPHP::Question) ? InstructionTag::Open : InstructionTag::None;
}
Sci_Position FindPhpStringDelimiter(std::string &phpStringDelimiter, Sci_Position i, const Sci_Position lengthDoc, Accessor &styler, bool &isSimpleString) {
@ -902,7 +908,7 @@ const LexicalClass lexicalClassesHTML[] = {
50, "SCE_HJ_SYMBOLS", "client javascript operator", "JS Symbols",
51, "SCE_HJ_STRINGEOL", "client javascript error literal string", "JavaScript EOL",
52, "SCE_HJ_REGEX", "client javascript literal regex", "JavaScript RegEx",
53, "", "unused", "",
53, "SCE_HJ_TEMPLATELITERAL", "client javascript literal template", "JS Template Literal",
54, "", "unused", "",
55, "SCE_HJA_START", "server javascript default", "JS Start - allows eol filled background to not start on same line as SCRIPT tag",
56, "SCE_HJA_DEFAULT", "server javascript default", "JS Default",
@ -917,7 +923,7 @@ const LexicalClass lexicalClassesHTML[] = {
65, "SCE_HJA_SYMBOLS", "server javascript operator", "JS Symbols",
66, "SCE_HJA_STRINGEOL", "server javascript error literal string", "JavaScript EOL",
67, "SCE_HJA_REGEX", "server javascript literal regex", "JavaScript RegEx",
68, "", "unused", "",
68, "SCE_HJA_TEMPLATELITERAL", "server javascript literal template", "JS Template Literal",
69, "", "unused", "",
70, "SCE_HB_START", "client basic default", "Start",
71, "SCE_HB_DEFAULT", "client basic default", "Default",
@ -1188,7 +1194,6 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
if (isPHPScript && (startPos == 0)) {
initStyle = SCE_HPHP_DEFAULT;
}
styler.StartAt(startPos);
std::string lastTag;
std::string prevWord;
PhpNumberState phpNumber;
@ -1199,23 +1204,18 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
int makoComment = 0;
std::string djangoBlockType;
// If inside a tag, it may be a script tag, so reread from the start of line starting tag to ensure any language tags are seen
if (InTagState(state)) {
while ((startPos > 0) && (InTagState(styler.StyleIndexAt(startPos - 1)))) {
// PHP string can be heredoc, must find a delimiter first. Reread from beginning of line containing the string, to get the correct lineState
if (StyleNeedsBacktrack(state)) {
while ((startPos > 0) && (StyleNeedsBacktrack(styler.StyleIndexAt(startPos - 1)))) {
const Sci_Position backLineStart = styler.LineStart(styler.GetLine(startPos-1));
length += startPos - backLineStart;
startPos = backLineStart;
}
state = SCE_H_DEFAULT;
}
// String can be heredoc, must find a delimiter first. Reread from beginning of line containing the string, to get the correct lineState
if (isPHPStringState(state)) {
while (startPos > 0 && (isPHPStringState(state) || !isLineEnd(styler[startPos - 1]))) {
startPos--;
length++;
state = styler.StyleIndexAt(startPos);
if (startPos > 0) {
state = styler.StyleIndexAt(startPos - 1);
} else {
state = isPHPScript ? SCE_HPHP_DEFAULT : SCE_H_DEFAULT;
}
if (startPos == 0)
state = SCE_H_DEFAULT;
}
styler.StartAt(startPos);
@ -1250,6 +1250,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
script_type clientScript = static_cast<script_type>((lineState >> 8) & 0x0F); // 4 bits of script name
int beforePreProc = (lineState >> 12) & 0xFF; // 8 bits of state
bool isLanguageType = (lineState >> 20) & 1; // type or language attribute for script tag
int sgmlBlockLevel = (lineState >> 21);
script_type scriptLanguage = ScriptOfState(state);
// If eNonHtmlScript coincides with SCE_H_COMMENT, assume eScriptComment
@ -1335,7 +1336,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
case eScriptPHP:
//not currently supported case eScriptVBS:
if (!AnyOf(state, SCE_HPHP_COMMENT, SCE_HPHP_COMMENTLINE, SCE_HJ_REGEX, SCE_HJ_COMMENT, SCE_HJ_COMMENTLINE, SCE_HJ_COMMENTDOC) &&
if (!AnyOf(state, SCE_HPHP_COMMENT, SCE_HPHP_COMMENTLINE, SCE_HJ_COMMENT, SCE_HJ_COMMENTLINE, SCE_HJ_COMMENTDOC) &&
!isStringState(state)) {
//Platform::DebugPrintf("state=%d, StateToPrint=%d, initStyle=%d\n", state, StateToPrint, initStyle);
//if ((state == SCE_HPHP_OPERATOR) || (state == SCE_HPHP_DEFAULT) || (state == SCE_HJ_SYMBOLS) || (state == SCE_HJ_START) || (state == SCE_HJ_DEFAULT)) {
@ -1410,7 +1411,8 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
((aspScript & 0x0F) << 4) |
((clientScript & 0x0F) << 8) |
((beforePreProc & 0xFF) << 12) |
((isLanguageType ? 1 : 0) << 20));
((isLanguageType ? 1 : 0) << 20) |
(sgmlBlockLevel << 21));
lineCurrent++;
lineStartVisibleChars = 0;
}
@ -1455,6 +1457,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
case SCE_HJ_DOUBLESTRING:
case SCE_HJ_SINGLESTRING:
case SCE_HJ_REGEX:
case SCE_HJ_TEMPLATELITERAL:
case SCE_HB_STRING:
case SCE_HBA_STRING:
case SCE_HP_STRING:
@ -1496,31 +1499,35 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
/////////////////////////////////////
// handle the start of PHP pre-processor = Non-HTML
else if ((ch == '<') && (chNext == '?') && IsPHPEntryState(state) && IsPHPStart(allowPHP, styler, i)) {
beforeLanguage = scriptLanguage;
scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP);
if ((scriptLanguage != eScriptPHP) && (isStringState(state) || (state==SCE_H_COMMENT))) continue;
styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state;
i++;
visibleChars++;
i += PrintScriptingIndicatorOffset(styler, styler.GetStartSegment() + 2, i + 6);
if (scriptLanguage == eScriptXML)
styler.ColourTo(i, SCE_H_XMLSTART);
else
styler.ColourTo(i, SCE_H_QUESTION);
state = StateForScript(scriptLanguage);
if (inScriptType == eNonHtmlScript)
inScriptType = eNonHtmlScriptPreProc;
else
inScriptType = eNonHtmlPreProc;
// Fold whole script, but not if the XML first tag (all XML-like tags in this case)
if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) {
levelCurrent++;
else if ((ch == '<') && (chNext == '?') && !IsPHPScriptState(state)) {
const InstructionTag tag = segIsScriptInstruction(allowPHP, state, styler, i + 2, isXml);
if (tag != InstructionTag::None) {
beforeLanguage = scriptLanguage;
scriptLanguage = (tag == InstructionTag::XML) ? eScriptXML : eScriptPHP;
styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state;
i++;
visibleChars++;
if (tag >= InstructionTag::Echo) {
i += (tag == InstructionTag::Echo) ? 1 : 3;
}
if (scriptLanguage == eScriptXML)
styler.ColourTo(i, SCE_H_XMLSTART);
else
styler.ColourTo(i, SCE_H_QUESTION);
state = StateForScript(scriptLanguage);
if (inScriptType == eNonHtmlScript)
inScriptType = eNonHtmlScriptPreProc;
else
inScriptType = eNonHtmlPreProc;
// Fold whole script, but not if the XML first tag (all XML-like tags in this case)
if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) {
levelCurrent++;
}
// should be better
ch = SafeGetUnsignedCharAt(styler, i);
continue;
}
// should be better
ch = SafeGetUnsignedCharAt(styler, i);
continue;
}
// handle the start Mako template Python code
@ -1662,16 +1669,13 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
/////////////////////////////////////
// handle the start of SGML language (DTD)
else if (((scriptLanguage == eScriptNone) || (scriptLanguage == eScriptXML)) &&
else if (AnyOf(scriptLanguage, eScriptNone, eScriptXML, eScriptSGMLblock) &&
(chPrev == '<') &&
(ch == '!') &&
(StateToPrint != SCE_H_CDATA) &&
(!isStringState(StateToPrint)) &&
(!IsCommentState(StateToPrint)) &&
(!IsScriptCommentState(StateToPrint))) {
AnyOf(state, SCE_H_DEFAULT, SCE_H_SGML_BLOCK_DEFAULT)) {
beforePreProc = state;
styler.ColourTo(i - 2, StateToPrint);
if ((chNext == '-') && (chNext2 == '-')) {
if ((state != SCE_H_SGML_BLOCK_DEFAULT) && (chNext == '-') && (chNext2 == '-')) {
state = SCE_H_COMMENT; // wait for a pending command
styler.ColourTo(i + 2, SCE_H_COMMENT);
i += 2; // follow styling after the --
@ -1687,12 +1691,18 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
ch = '-';
}
}
} else if (isWordCdata(i + 1, i + 7, styler)) {
} else if ((state != SCE_H_SGML_BLOCK_DEFAULT) && isWordCdata(i + 1, i + 7, styler)) {
state = SCE_H_CDATA;
} else {
styler.ColourTo(i, SCE_H_SGML_DEFAULT); // <! is default
beforeLanguage = scriptLanguage;
scriptLanguage = eScriptSGML;
state = SCE_H_SGML_COMMAND; // wait for a pending command
if ((chNext == '-') && (chNext2 == '-')) {
i += 2;
state = SCE_H_SGML_COMMENT;
} else {
state = (chNext == '[') ? SCE_H_SGML_DEFAULT : SCE_H_SGML_COMMAND; // wait for a pending command
}
}
// fold whole tag (-- when closing the tag)
if (foldHTMLPreprocessor || state == SCE_H_COMMENT || state == SCE_H_CDATA)
@ -1763,7 +1773,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
else if ((!isMako && !isDjango && ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) &&
(((scriptLanguage != eScriptNone) && stateAllowsTermination(state))) &&
((chNext == '>') && isPreProcessorEndTag(state, ch))) ||
((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) {
((scriptLanguage == eScriptSGML) && (ch == '>') && !AnyOf(state, SCE_H_SGML_COMMENT, SCE_H_SGML_DOUBLESTRING, SCE_H_SGML_SIMPLESTRING))) {
if (state == SCE_H_ASPAT) {
aspScript = segIsScriptingIndicator(styler,
styler.GetStartSegment(), i - 1, aspScript);
@ -1851,41 +1861,36 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
styler.ColourTo(i - 2, StateToPrint);
}
state = SCE_H_SGML_COMMENT;
} else if (IsUpperOrLowerCase(ch) && (chPrev == '%')) {
styler.ColourTo(i - 2, StateToPrint);
} else if (ch == '%' && IsUpperOrLowerCase(chNext)) {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_H_SGML_ENTITY;
} else if (ch == '#') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_H_SGML_SPECIAL;
} else if (ch == '[') {
styler.ColourTo(i - 1, StateToPrint);
styler.ColourTo(i, SCE_H_SGML_DEFAULT);
++sgmlBlockLevel;
scriptLanguage = eScriptSGMLblock;
state = SCE_H_SGML_BLOCK_DEFAULT;
} else if (ch == ']') {
if (scriptLanguage == eScriptSGMLblock) {
styler.ColourTo(i, StateToPrint);
if (sgmlBlockLevel > 0) {
--sgmlBlockLevel;
if (sgmlBlockLevel == 0) {
beforePreProc = SCE_H_DEFAULT;
}
styler.ColourTo(i - 1, StateToPrint);
styler.ColourTo(i, SCE_H_SGML_DEFAULT);
scriptLanguage = eScriptSGML;
} else {
styler.ColourTo(i - 1, StateToPrint);
styler.ColourTo(i, SCE_H_SGML_ERROR);
}
state = SCE_H_SGML_DEFAULT;
} else if (scriptLanguage == eScriptSGMLblock) {
if ((ch == '!') && (chPrev == '<')) {
styler.ColourTo(i - 2, StateToPrint);
styler.ColourTo(i, SCE_H_SGML_DEFAULT);
state = SCE_H_SGML_COMMAND;
} else if (ch == '>') {
styler.ColourTo(i - 1, StateToPrint);
styler.ColourTo(i, SCE_H_SGML_DEFAULT);
}
}
break;
case SCE_H_SGML_COMMAND:
if ((ch == '-') && (chPrev == '-')) {
styler.ColourTo(i - 2, StateToPrint);
state = SCE_H_SGML_COMMENT;
} else if (!issgmlwordchar(ch)) {
if (!issgmlwordchar(ch)) {
if (isWordHSGML(styler.GetStartSegment(), i - 1, keywordsSGML, styler)) {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_H_SGML_1ST_PARAM;
@ -1897,18 +1902,10 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
case SCE_H_SGML_1ST_PARAM:
// wait for the beginning of the word
if ((ch == '-') && (chPrev == '-')) {
if (scriptLanguage == eScriptSGMLblock) {
styler.ColourTo(i - 2, SCE_H_SGML_BLOCK_DEFAULT);
} else {
styler.ColourTo(i - 2, SCE_H_SGML_DEFAULT);
}
styler.ColourTo(i - 2, SCE_H_SGML_DEFAULT);
state = SCE_H_SGML_1ST_PARAM_COMMENT;
} else if (issgmlwordchar(ch)) {
if (scriptLanguage == eScriptSGMLblock) {
styler.ColourTo(i - 1, SCE_H_SGML_BLOCK_DEFAULT);
} else {
styler.ColourTo(i - 1, SCE_H_SGML_DEFAULT);
}
styler.ColourTo(i - 1, SCE_H_SGML_DEFAULT);
// find the length of the word
Sci_Position size = 1;
while (setHTMLWord.Contains(SafeGetUnsignedCharAt(styler, i + size)))
@ -1917,11 +1914,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
i += size - 1;
visibleChars += size - 1;
ch = SafeGetUnsignedCharAt(styler, i);
if (scriptLanguage == eScriptSGMLblock) {
state = SCE_H_SGML_BLOCK_DEFAULT;
} else {
state = SCE_H_SGML_DEFAULT;
}
state = SCE_H_SGML_DEFAULT;
continue;
}
break;
@ -1985,12 +1978,9 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
}
break;
case SCE_H_SGML_ENTITY:
if (ch == ';') {
styler.ColourTo(i, StateToPrint);
state = SCE_H_SGML_DEFAULT;
} else if (!(IsAlphaNumeric(ch)) && ch != '-' && ch != '.') {
styler.ColourTo(i, SCE_H_SGML_ERROR);
state = SCE_H_SGML_DEFAULT;
if (!(IsAlphaNumeric(ch)) && ch != '-' && ch != '.' && ch != '_') {
styler.ColourTo(i, ((ch == ';') ? StateToPrint : SCE_H_SGML_ERROR));
state = defaultStateForSGML(scriptLanguage);
}
break;
case SCE_H_ENTITY:
@ -2203,14 +2193,11 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
state = SCE_HJ_WORD;
} else if (ch == '/' && chNext == '*') {
styler.ColourTo(i - 1, StateToPrint);
i++;
if (chNext2 == '*')
state = SCE_HJ_COMMENTDOC;
else
state = SCE_HJ_COMMENT;
if (chNext2 == '/') {
// Eat the * so it isn't used for the end of the comment
i++;
}
} else if (ch == '/' && chNext == '/') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_COMMENTLINE;
@ -2223,6 +2210,9 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
} else if (ch == '\'') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_SINGLESTRING;
} else if (ch == '`') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_TEMPLATELITERAL;
} else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') &&
styler.SafeGetCharAt(i + 3) == '-') {
styler.ColourTo(i - 1, StateToPrint);
@ -2249,6 +2239,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
//styler.ColourTo(i - 1, eHTJSKeyword);
state = SCE_HJ_DEFAULT;
if (ch == '/' && chNext == '*') {
i++;
if (chNext2 == '*')
state = SCE_HJ_COMMENTDOC;
else
@ -2259,6 +2250,8 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
state = SCE_HJ_DOUBLESTRING;
} else if (ch == '\'') {
state = SCE_HJ_SINGLESTRING;
} else if (ch == '`') {
state = SCE_HJ_TEMPLATELITERAL;
} else if ((ch == '-') && (chNext == '-') && (chNext2 == '>')) {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_COMMENTLINE;
@ -2314,6 +2307,16 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
}
}
break;
case SCE_HJ_TEMPLATELITERAL:
if (ch == '\\') {
if (chNext == '$' || chNext == '`' || chNext == '\\') {
i++;
}
} else if (ch == '`') {
styler.ColourTo(i, statePrintForState(SCE_HJ_TEMPLATELITERAL, inScriptType));
state = SCE_HJ_DEFAULT;
}
break;
case SCE_HJ_STRINGEOL:
if (!isLineEnd(ch)) {
styler.ColourTo(i - 1, StateToPrint);
@ -2711,7 +2714,8 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
}
} else if (state == SCE_HJ_DEFAULT) { // One of the above succeeded
if (ch == '/' && chNext == '*') {
if (styler.SafeGetCharAt(i + 2) == '*')
i++;
if (styler.SafeGetCharAt(i + 1) == '*')
state = SCE_HJ_COMMENTDOC;
else
state = SCE_HJ_COMMENT;
@ -2721,6 +2725,8 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
state = SCE_HJ_DOUBLESTRING;
} else if ((ch == '\'') && (nonEmptySegment)) {
state = SCE_HJ_SINGLESTRING;
} else if ((ch == '`') && (nonEmptySegment)) {
state = SCE_HJ_TEMPLATELITERAL;
} else if (IsAWordStart(ch)) {
state = SCE_HJ_WORD;
} else if (IsOperator(ch)) {

View File

@ -36,10 +36,23 @@
using namespace Scintilla;
using namespace Lexilla;
static const int NUM_RUST_KEYWORD_LISTS = 7;
static const int MAX_RUST_IDENT_CHARS = 1023;
namespace {
static bool IsStreamCommentStyle(int style) {
constexpr int NUM_RUST_KEYWORD_LISTS = 7;
constexpr int MAX_RUST_IDENT_CHARS = 1023;
enum class StringType : int {
STRING = SCE_RUST_STRING,
BYTESTRING = SCE_RUST_BYTESTRING,
CSTRING = SCE_RUST_CSTRING,
RAW_STRING = SCE_RUST_STRINGR,
RAW_BYTESTRING = SCE_RUST_BYTESTRINGR,
RAW_CSTRING = SCE_RUST_CSTRINGR
};
static bool IsStreamCommentStyle(int style) noexcept {
return style == SCE_RUST_COMMENTBLOCK ||
style == SCE_RUST_COMMENTBLOCKDOC;
}
@ -73,15 +86,15 @@ struct OptionsRust {
};
static const char * const rustWordLists[NUM_RUST_KEYWORD_LISTS + 1] = {
"Primary keywords and identifiers",
"Built in types",
"Other keywords",
"Keywords 4",
"Keywords 5",
"Keywords 6",
"Keywords 7",
0,
};
"Primary keywords and identifiers",
"Built in types",
"Other keywords",
"Keywords 4",
"Keywords 5",
"Keywords 6",
"Keywords 7",
0,
};
struct OptionSetRust : public OptionSet<OptionsRust> {
OptionSetRust() {
@ -208,7 +221,7 @@ static void GrabString(char* s, Accessor& styler, Sci_Position start, Sci_Positi
}
static void ScanRawIdentifier(Accessor& styler, Sci_Position& pos) {
Sci_Position start = pos;
const Sci_Position start = pos;
while (IsIdentifierContinue(styler.SafeGetCharAt(pos, '\0')))
pos++;
@ -226,7 +239,7 @@ static void ScanRawIdentifier(Accessor& styler, Sci_Position& pos) {
}
static void ScanIdentifier(Accessor& styler, Sci_Position& pos, WordList *keywords) {
Sci_Position start = pos;
const Sci_Position start = pos;
while (IsIdentifierContinue(styler.SafeGetCharAt(pos, '\0')))
pos++;
@ -254,9 +267,9 @@ static void ScanIdentifier(Accessor& styler, Sci_Position& pos, WordList *keywor
/* Scans a sequence of digits, returning true if it found any. */
static bool ScanDigits(Accessor& styler, Sci_Position& pos, int base) {
Sci_Position old_pos = pos;
const Sci_Position old_pos = pos;
for (;;) {
int c = styler.SafeGetCharAt(pos, '\0');
const int c = styler.SafeGetCharAt(pos, '\0');
if (IsADigit(c, base) || c == '_')
pos++;
else
@ -397,7 +410,7 @@ static bool IsValidStringEscape(int c) {
static bool ScanNumericEscape(Accessor &styler, Sci_Position& pos, Sci_Position num_digits, bool stop_asap) {
for (;;) {
int c = styler.SafeGetCharAt(pos, '\0');
const int c = styler.SafeGetCharAt(pos, '\0');
if (!IsADigit(c, 16))
break;
num_digits--;
@ -508,7 +521,7 @@ static void ResumeBlockComment(Accessor &styler, Sci_Position& pos, Sci_Position
int c = styler.SafeGetCharAt(pos, '\0');
bool maybe_doc_comment = false;
if (c == '*') {
int n = styler.SafeGetCharAt(pos + 1, '\0');
const int n = styler.SafeGetCharAt(pos + 1, '\0');
if (n != '*' && n != '/') {
maybe_doc_comment = true;
}
@ -517,7 +530,7 @@ static void ResumeBlockComment(Accessor &styler, Sci_Position& pos, Sci_Position
}
for (;;) {
int n = styler.SafeGetCharAt(pos + 1, '\0');
const int n = styler.SafeGetCharAt(pos + 1, '\0');
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), level);
if (c == '*') {
@ -585,7 +598,7 @@ static void ResumeLineComment(Accessor &styler, Sci_Position& pos, Sci_Position
static void ScanComments(Accessor &styler, Sci_Position& pos, Sci_Position max) {
pos++;
int c = styler.SafeGetCharAt(pos, '\0');
const int c = styler.SafeGetCharAt(pos, '\0');
pos++;
if (c == '/')
ResumeLineComment(styler, pos, max, UnknownComment);
@ -593,7 +606,7 @@ static void ScanComments(Accessor &styler, Sci_Position& pos, Sci_Position max)
ResumeBlockComment(styler, pos, max, UnknownComment, 1);
}
static void ResumeString(Accessor &styler, Sci_Position& pos, Sci_Position max, bool ascii_only) {
static void ResumeString(Accessor &styler, Sci_Position& pos, Sci_Position max, StringType string_type) {
int c = styler.SafeGetCharAt(pos, '\0');
bool error = false;
while (c != '"' && !error) {
@ -604,13 +617,13 @@ static void ResumeString(Accessor &styler, Sci_Position& pos, Sci_Position max,
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), 0);
if (c == '\\') {
int n = styler.SafeGetCharAt(pos + 1, '\0');
const int n = styler.SafeGetCharAt(pos + 1, '\0');
if (IsValidStringEscape(n)) {
pos += 2;
} else if (n == 'x') {
pos += 2;
error = !ScanNumericEscape(styler, pos, 2, true);
} else if (n == 'u' && !ascii_only) {
} else if (n == 'u' && (string_type != StringType::BYTESTRING)) {
pos += 2;
if (styler.SafeGetCharAt(pos, '\0') != '{') {
// old-style
@ -624,7 +637,7 @@ static void ResumeString(Accessor &styler, Sci_Position& pos, Sci_Position max,
else
error = true;
}
} else if (n == 'U' && !ascii_only) {
} else if (n == 'U' && (string_type != StringType::BYTESTRING)) {
pos += 2;
error = !ScanNumericEscape(styler, pos, 8, true);
} else {
@ -632,7 +645,7 @@ static void ResumeString(Accessor &styler, Sci_Position& pos, Sci_Position max,
error = true;
}
} else {
if (ascii_only && !IsASCII((char)c))
if (string_type == StringType::BYTESTRING && !IsASCII((char)c))
error = true;
else
pos++;
@ -641,15 +654,16 @@ static void ResumeString(Accessor &styler, Sci_Position& pos, Sci_Position max,
}
if (!error)
pos++;
styler.ColourTo(pos - 1, ascii_only ? SCE_RUST_BYTESTRING : SCE_RUST_STRING);
styler.ColourTo(pos - 1, static_cast<int>(string_type));
}
static void ResumeRawString(Accessor &styler, Sci_Position& pos, Sci_Position max, int num_hashes, bool ascii_only) {
static void ResumeRawString(Accessor &styler, Sci_Position& pos, Sci_Position max, int num_hashes, StringType string_type) {
for (;;) {
if (pos == styler.LineEnd(styler.GetLine(pos)))
styler.SetLineState(styler.GetLine(pos), num_hashes);
int c = styler.SafeGetCharAt(pos, '\0');
const int c = styler.SafeGetCharAt(pos, '\0');
if (c == '"') {
pos++;
int trailing_num_hashes = 0;
@ -664,15 +678,16 @@ static void ResumeRawString(Accessor &styler, Sci_Position& pos, Sci_Position ma
} else if (pos >= max) {
break;
} else {
if (ascii_only && !IsASCII((char)c))
if ((string_type == StringType::RAW_BYTESTRING) && !IsASCII((char)c))
break;
pos++;
}
}
styler.ColourTo(pos - 1, ascii_only ? SCE_RUST_BYTESTRINGR : SCE_RUST_STRINGR);
styler.ColourTo(pos - 1, static_cast<int>(string_type));
}
static void ScanRawString(Accessor &styler, Sci_Position& pos, Sci_Position max, bool ascii_only) {
static void ScanRawString(Accessor &styler, Sci_Position& pos, Sci_Position max, StringType string_type) {
pos++;
int num_hashes = 0;
while (styler.SafeGetCharAt(pos, '\0') == '#') {
@ -683,7 +698,7 @@ static void ScanRawString(Accessor &styler, Sci_Position& pos, Sci_Position max,
styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
} else {
pos++;
ResumeRawString(styler, pos, max, num_hashes, ascii_only);
ResumeRawString(styler, pos, max, num_hashes, string_type);
}
}
@ -691,7 +706,7 @@ void SCI_METHOD LexerRust::Lex(Sci_PositionU startPos, Sci_Position length, int
PropSetSimple props;
Accessor styler(pAccess, &props);
Sci_Position pos = startPos;
Sci_Position max = pos + length;
const Sci_Position max = pos + length;
styler.StartAt(pos);
styler.StartSegment(pos);
@ -701,19 +716,22 @@ void SCI_METHOD LexerRust::Lex(Sci_PositionU startPos, Sci_Position length, int
} else if (initStyle == SCE_RUST_COMMENTLINE || initStyle == SCE_RUST_COMMENTLINEDOC) {
ResumeLineComment(styler, pos, max, initStyle == SCE_RUST_COMMENTLINEDOC ? DocComment : NotDocComment);
} else if (initStyle == SCE_RUST_STRING) {
ResumeString(styler, pos, max, false);
ResumeString(styler, pos, max, StringType::STRING);
} else if (initStyle == SCE_RUST_BYTESTRING) {
ResumeString(styler, pos, max, true);
ResumeString(styler, pos, max, StringType::BYTESTRING);
} else if (initStyle == SCE_RUST_STRINGR) {
ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), false);
ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), StringType::RAW_STRING);
} else if (initStyle == SCE_RUST_BYTESTRINGR) {
ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), true);
ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), StringType::RAW_BYTESTRING);
} else if (initStyle == SCE_RUST_CSTRING) {
ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), StringType::CSTRING);
} else if (initStyle == SCE_RUST_CSTRINGR) {
ResumeRawString(styler, pos, max, styler.GetLineState(styler.GetLine(pos) - 1), StringType::RAW_CSTRING);
}
while (pos < max) {
int c = styler.SafeGetCharAt(pos, '\0');
int n = styler.SafeGetCharAt(pos + 1, '\0');
int n2 = styler.SafeGetCharAt(pos + 2, '\0');
const int c = styler.SafeGetCharAt(pos, '\0');
const int n = styler.SafeGetCharAt(pos + 1, '\0');
const int n2 = styler.SafeGetCharAt(pos + 2, '\0');
if (pos == 0 && c == '#' && n == '!' && n2 != '[') {
pos += 2;
@ -726,13 +744,19 @@ void SCI_METHOD LexerRust::Lex(Sci_PositionU startPos, Sci_Position length, int
pos += 2;
ScanRawIdentifier(styler, pos);
} else if (c == 'r' && (n == '#' || n == '"')) {
ScanRawString(styler, pos, max, false);
ScanRawString(styler, pos, max, StringType::RAW_STRING);
} else if (c == 'b' && n == 'r' && (n2 == '#' || n2 == '"')) {
pos++;
ScanRawString(styler, pos, max, true);
ScanRawString(styler, pos, max, StringType::RAW_BYTESTRING);
} else if (c == 'b' && n == '"') {
pos += 2;
ResumeString(styler, pos, max, true);
ResumeString(styler, pos, max, StringType::BYTESTRING);
} else if (c == 'c' && n == 'r' && (n2 == '#' || n2 == '"')) {
pos++;
ScanRawString(styler, pos, max, StringType::RAW_CSTRING);
} else if (c == 'c' && n == '"') {
pos += 2;
ResumeString(styler, pos, max, StringType::CSTRING);
} else if (c == 'b' && n == '\'') {
pos++;
ScanCharacterLiteralOrLifetime(styler, pos, true);
@ -753,7 +777,7 @@ void SCI_METHOD LexerRust::Lex(Sci_PositionU startPos, Sci_Position length, int
ScanCharacterLiteralOrLifetime(styler, pos, false);
} else if (c == '"') {
pos++;
ResumeString(styler, pos, max, false);
ResumeString(styler, pos, max, StringType::STRING);
} else {
pos++;
styler.ColourTo(pos - 1, SCE_RUST_LEXERROR);
@ -770,7 +794,7 @@ void SCI_METHOD LexerRust::Fold(Sci_PositionU startPos, Sci_Position length, int
LexAccessor styler(pAccess);
Sci_PositionU endPos = startPos + length;
const Sci_PositionU endPos = startPos + length;
int visibleChars = 0;
bool inLineComment = false;
Sci_Position lineCurrent = styler.GetLine(startPos);
@ -785,12 +809,12 @@ void SCI_METHOD LexerRust::Fold(Sci_PositionU startPos, Sci_Position length, int
int style = initStyle;
const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty();
for (Sci_PositionU i = startPos; i < endPos; i++) {
char ch = chNext;
const char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
int stylePrev = style;
const int stylePrev = style;
style = styleNext;
styleNext = styler.StyleAt(i + 1);
bool atEOL = i == (lineStartNext-1);
const bool atEOL = i == (lineStartNext-1);
if ((style == SCE_RUST_COMMENTLINE) || (style == SCE_RUST_COMMENTLINEDOC))
inLineComment = true;
if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) {
@ -810,7 +834,7 @@ void SCI_METHOD LexerRust::Fold(Sci_PositionU startPos, Sci_Position length, int
}
} else {
if ((ch == '/') && (chNext == '/')) {
char chNext2 = styler.SafeGetCharAt(i + 2);
const char chNext2 = styler.SafeGetCharAt(i + 2);
if (chNext2 == '{') {
levelNext++;
} else if (chNext2 == '}') {
@ -860,4 +884,6 @@ void SCI_METHOD LexerRust::Fold(Sci_PositionU startPos, Sci_Position length, int
}
}
}
extern const LexerModule lmRust(SCLEX_RUST, LexerRust::LexerFactoryRust, "rust", rustWordLists);

View File

@ -259,12 +259,9 @@ void ColouriseTOMLDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
}
} else if (sc.state == SCE_TOML_KEY && !IsTOMLUnquotedKey(sc.ch)) {
const int chNext = GetLineNextChar(sc);
if (chNext == '=') {
if (chNext == '=' || (chNext != '.' && chPrevNonWhite != '.')) {
keyState = TOMLKeyState::End;
sc.SetState(SCE_TOML_DEFAULT);
} else if (chNext != '.' && chPrevNonWhite != '.') {
sc.ChangeState(SCE_TOML_ERROR);
continue;
}
}
}

View File

@ -363,6 +363,9 @@ void LexerVB::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, ID
}
void LexerVB::Fold(Sci_PositionU startPos, Sci_Position length, int, IDocument *pAccess) {
if (!options.fold)
return;
Accessor styler(pAccess, nullptr);
const Sci_Position endPos = startPos + length;

View File

@ -1,777 +0,0 @@
// encoding: UTF-8
// Scintilla source code edit control
/** @file LexDart.cxx
** Lexer for Dart Language Source Code
** Original Code by Zufuliu, Adapted by RaiKoHoff
** Dart Spec: https://dart.dev/guides/language/spec
**/
#include <cassert>
#include <string>
#include <map>
#include <vector>
#include "ILexer.h"
#include "Scintilla.h"
#include "StringCopy.h"
#include "PropSetSimple.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "LexerModule.h"
#include "DefaultLexer.h"
#include "OptionSet.h"
#include "WordList.h"
//
#include "CharSetX.h"
#include "SciXLexer.h"
#include "StringUtils.h"
#include "LexerUtils.h"
using namespace Lexilla;
using namespace Scintilla;
namespace
{
// Use an unnamed namespace to protect the functions and classes from name conflicts
struct OptionsDart
{
bool fold;
bool foldComment;
//bool foldCompact;
OptionsDart()
: fold(false)
, foldComment(true)
//, foldCompact(true)
{ }
};
static const char* const dartWordLists[] =
{
"Keywords",
"Types",
"Classes",
"Enums",
"MetaData",
"Functions",
nullptr
};
struct OptionSetDart : public OptionSet<OptionsDart>
{
OptionSetDart()
{
DefineProperty("fold", &OptionsDart::fold);
DefineProperty("fold.comment", &OptionsDart::foldComment);
//DefineProperty("fold.compact", &OptionsDart::foldCompact);
DefineWordListSets(dartWordLists);
}
};
LexicalClass lexicalClasses[] =
{
// Lexer Dart SCLEX_DART SCE_DART_:
SCE_DART_DEFAULT, "SCE_DART_DEFAULT", "default", "Descr",
SCE_DART_COMMENTLINE, "SCE_DART_COMMENTLINE", "commentline", "Descr",
SCE_DART_COMMENTLINEDOC, "SCE_DART_COMMENTLINEDOC", "commentlinedoc", "Descr",
SCE_DART_COMMENTBLOCK, "SCE_DART_COMMENTBLOCK", "commentblock", "Descr",
SCE_DART_COMMENTBLOCKDOC, "SCE_DART_COMMENTBLOCKDOC", "commentblockdoc", "Descr",
SCE_DART_TASKMARKER, "SCE_DART_TASKMARKER", "taskmarker", "Descr",
SCE_DART_NUMBER, "SCE_DART_NUMBER", "number", "Descr",
SCE_DART_OPERATOR, "SCE_DART_OPERATOR", "operator", "Descr",
SCE_DART_OPERATOR2, "SCE_DART_OPERATOR2", "operator2", "Descr",
SCE_DART_IDENTIFIER, "SCE_DART_IDENTIFIER", "identifier", "Descr",
SCE_DART_ESCAPECHAR, "SCE_DART_ESCAPECHAR ", "string_sq", "Descr",
SCE_DART_STRING_SQ, "SCE_DART_STRING_SQ", "string_dq", "Descr",
SCE_DART_STRING_DQ, "SCE_DART_STRING_DQ", "tristrg_sq", "Descr",
SCE_DART_TRIPLE_STRING_SQ, "SCE_DART_TRIPLE_STRING_SQ", "tristrg_dq", "Descr",
SCE_DART_TRIPLE_STRING_DQ, "SCE_DART_TRIPLE_STRING_DQ", "escchar", "Descr",
SCE_DART_RAWSTRING_SQ, "SCE_DART_RAWSTRING_SQ", "rawstrg_sq", "Descr",
SCE_DART_RAWSTRING_DQ, "SCE_DART_RAWSTRING_DQ", "rawstrg_dq", "Descr",
SCE_DART_TRIPLE_RAWSTRING_SQ, "SCE_DART_TRIPLE_RAWSTRING_SQ", "trirawstrg_sq", "Descr",
SCE_DART_TRIPLE_RAWSTRING_DQ, "SCE_DART_TRIPLE_RAWSTRING_DQ", "trirawstrg_dq", "Descr",
SCE_DART_SYMBOL_OPERATOR, "SCE_DART_SYMBOL_OPERATOR", "sym_operator", "Descr",
SCE_DART_SYMBOL_IDENTIFIER, "SCE_DART_SYMBOL_IDENTIFIER", "sym_identifier", "Descr",
SCE_DART_VARIABLE, "SCE_DART_VARIABLE", "variable", "Descr",
SCE_DART_METADATA, "SCE_DART_METADATA", "metadata", "Descr",
SCE_DART_LABEL, "SCE_DART_LABEL", "label", "Descr",
SCE_DART_FUNCTION, "SCE_DART_FUNCTION", "function", "Descr",
SCE_DART_WORD, "SCE_DART_WORD", "keword", "Descr",
SCE_DART_WORD2, "SCE_DART_WORD2", "keyword2", "Descr",
SCE_DART_CLASS, "SCE_DART_CLASS", "class", "Descr",
SCE_DART_ENUM, "SCE_DART_ENUM", "enum", "Descr"
};
} // end of namespace
class LexerDart : public DefaultLexer
{
//CharacterSet validKey;
//CharacterSet validKeyWord;
//CharacterSet validNumberEnd;
//CharacterSet chDateTime;
WordList keywordLists[KEYWORDSET_MAX + 1];
OptionsDart options;
OptionSetDart osDart;
public:
LexerDart()
: DefaultLexer("Dart", SCLEX_DART, lexicalClasses, ELEMENTS(lexicalClasses))
//, validKey(CharacterSet::setAlphaNum, R"(-_.)", 0x80, false)
//, validKeyWord(CharacterSet::setAlphaNum, "_+-", 0x80, false)
//, validNumberEnd(CharacterSet::setNone, " \t\n\v\f\r#,)}]", 0x80, false)
//, chDateTime(CharacterSet::setNone, "-+.:TZ", 0x80, false)
{ }
virtual ~LexerDart() = default;
void SCI_METHOD Release() override
{
delete this;
}
int SCI_METHOD Version() const override
{
return lvRelease5;
}
const char* SCI_METHOD PropertyNames() override
{
return osDart.PropertyNames();
}
int SCI_METHOD PropertyType(const char* name) override
{
return osDart.PropertyType(name);
}
const char* SCI_METHOD PropertyGet(const char* name) override
{
return osDart.PropertyGet(name);
}
const char* SCI_METHOD DescribeProperty(const char* name) override
{
return osDart.DescribeProperty(name);
}
const char* SCI_METHOD DescribeWordListSets() override
{
return osDart.DescribeWordListSets();
}
void* SCI_METHOD PrivateCall(int, void*) override
{
return nullptr;
}
int SCI_METHOD LineEndTypesSupported() override
{
return SC_LINE_END_TYPE_DEFAULT;
}
int SCI_METHOD PrimaryStyleFromStyle(int style) override
{
return style;
}
static ILexer5* LexerFactoryDart()
{
return new LexerDart();
}
// --------------------------------------------------------------------------
Sci_Position SCI_METHOD PropertySet(const char* key, const char* val) override;
Sci_Position SCI_METHOD WordListSet(int n, const char* wl) override;
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument* pAccess) override;
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument* pAccess) override;
};
Sci_Position SCI_METHOD LexerDart::PropertySet(const char* key, const char* val)
{
if (osDart.PropertySet(&options, key, val))
{
return 0;
}
return -1;
}
enum {
KeywordIndex_Keyword = 0,
KeywordIndex_Type = 1,
KeywordIndex_Class = 2,
KeywordIndex_Enumeration = 3,
KeywordIndex_MetaData = 4,
KeywordIndex_Function = 5
};
Sci_Position SCI_METHOD LexerDart::WordListSet(int n, const char* wl)
{
WordList* wordListN = &(keywordLists[n]);
Sci_Position firstModification = -1LL;
if (wordListN) {
if (wordListN->Set(wl)) {
firstModification = 0;
}
}
return firstModification;
}
// ----------------------------------------------------------------------------
struct EscapeSequence {
int outerState = SCE_DART_DEFAULT;
int digitsLeft = 0;
bool brace = false;
// highlight any character as escape sequence.
bool resetEscapeState(int state, int chNext) noexcept {
if (IsNewline(chNext)) {
return false;
}
outerState = state;
brace = false;
digitsLeft = (chNext == 'x') ? 3 : ((chNext == 'u') ? 5 : 1);
return true;
}
bool atEscapeEnd(int ch) noexcept {
--digitsLeft;
return digitsLeft <= 0 || !IsHexDigit(ch);
}
};
enum {
DartLineStateMaskLineComment = 1, // line comment
DartLineStateMaskImport = (1 << 1), // import
};
enum class KeywordType {
None = SCE_DART_DEFAULT,
Class = SCE_DART_CLASS,
Enum = SCE_DART_ENUM,
Label = SCE_DART_LABEL,
Return = 0x40,
While,
};
static_assert(DefaultNestedStateBaseStyle + 1 == SCE_DART_STRING_SQ);
static_assert(DefaultNestedStateBaseStyle + 2 == SCE_DART_STRING_DQ);
static_assert(DefaultNestedStateBaseStyle + 3 == SCE_DART_TRIPLE_STRING_SQ);
static_assert(DefaultNestedStateBaseStyle + 4 == SCE_DART_TRIPLE_STRING_DQ);
constexpr bool IsDeclarableOperator(int ch) noexcept {
// https://github.com/dart-lang/sdk/blob/main/sdk/lib/core/symbol.dart
return AnyOf(ch, '+', '-', '*', '/', '%', '~', '&', '|',
'^', '<', '>', '=', '[', ']');
}
constexpr bool IsSpaceEquiv(int state) noexcept {
return state <= SCE_DART_TASKMARKER;
}
constexpr bool IsTripleString(int state) noexcept {
return ((state - SCE_DART_STRING_SQ) & 3) > 1;
}
constexpr int GetStringQuote(int state) noexcept {
if constexpr (SCE_DART_STRING_SQ & 1) {
return (state & 1) ? '\'' : '\"';
} else {
return (state & 1) ? '\"' : '\'';
}
}
void SCI_METHOD LexerDart::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument* pAccess)
{
PropSetSimple props;
Accessor styler(pAccess, &props);
int lineStateLineType = 0;
int commentLevel = 0; // nested block comment level
KeywordType kwType = KeywordType::None;
int chBeforeIdentifier = 0;
std::vector<int> nestedState; // string interpolation "${}"
int visibleChars = 0;
int chBefore = 0;
int visibleCharsBefore = 0;
int chPrevNonWhite = 0;
bool simpleStringInterpolation = false;
EscapeSequence escSeq;
StyleContext sc(startPos, lengthDoc, initStyle, styler);
if (sc.currentLine > 0) {
int lineState = styler.GetLineState(sc.currentLine - 1);
/*
2: lineStateLineType
6: commentLevel
3: nestedState count
3*4: nestedState
*/
commentLevel = (lineState >> 2) & 0x3f;
lineState >>= 8;
if (lineState) {
UnpackLineState(lineState, nestedState);
}
}
if (startPos == 0) {
if (sc.Match('#', '!')) {
// Shell Shebang at beginning of file
sc.SetState(SCE_DART_COMMENTLINE);
sc.Forward();
lineStateLineType = DartLineStateMaskLineComment;
}
} else if (IsSpaceEquiv(initStyle)) {
LookbackNonWhite(styler, startPos, SCE_DART_TASKMARKER, chPrevNonWhite, initStyle);
}
while (sc.More()) {
switch (sc.state) {
case SCE_DART_OPERATOR:
case SCE_DART_OPERATOR2:
sc.SetState(SCE_DART_DEFAULT);
break;
case SCE_DART_NUMBER:
if (!IsDecimalNumber(sc.chPrev, sc.ch, sc.chNext)) {
sc.SetState(SCE_DART_DEFAULT);
}
break;
case SCE_DART_IDENTIFIER:
case SCE_DART_VARIABLE:
case SCE_DART_VARIABLE2:
case SCE_DART_METADATA:
case SCE_DART_SYMBOL_IDENTIFIER:
if (!IsIdentifierCharEx(sc.ch)) {
switch (sc.state) {
case SCE_DART_VARIABLE2:
sc.SetState(escSeq.outerState);
continue;
case SCE_DART_METADATA:
case SCE_DART_SYMBOL_IDENTIFIER:
if (sc.ch == '.') {
const int state = sc.state;
sc.SetState(SCE_DART_OPERATOR);
sc.ForwardSetState(state);
continue;
}
break;
case SCE_DART_IDENTIFIER: {
char s[128];
sc.GetCurrent(s, sizeof(s));
if (keywordLists[KeywordIndex_Keyword].InList(s)) {
sc.ChangeState(SCE_DART_WORD);
if (StrEqualsAny(s, "import", "part")) {
if (visibleChars == sc.LengthCurrent()) {
lineStateLineType = DartLineStateMaskImport;
}
} else if (StrEqualsAny(s, "class", "extends", "implements", "new", "throw", "with", "as", "is", "on")) {
kwType = KeywordType::Class;
} else if (StrEqual(s, "enum")) {
kwType = KeywordType::Enum;
} else if (StrEqualsAny(s, "break", "continue")) {
kwType = KeywordType::Label;
} else if (StrEqualsAny(s, "return", "await", "yield")) {
kwType = KeywordType::Return;
}
if (kwType > KeywordType::None && kwType < KeywordType::Return) {
const int chNext = GetLineNextChar(styler, sc);
if (!IsIdentifierStartEx(chNext)) {
kwType = KeywordType::None;
}
}
} else if (keywordLists[KeywordIndex_Type].InList(s)) {
sc.ChangeState(SCE_DART_WORD2);
} else if (keywordLists[KeywordIndex_Class].InList(s)) {
sc.ChangeState(SCE_DART_CLASS);
} else if (keywordLists[KeywordIndex_Enumeration].InList(s)) {
sc.ChangeState(SCE_DART_ENUM);
} else if (sc.ch == ':') {
if (chBefore == ',' || chBefore == '{') {
sc.ChangeState(SCE_DART_KEY);
} else if (IsJumpLabelPrevChar(chBefore)) {
sc.ChangeState(SCE_DART_LABEL);
}
} else if (sc.ch != '.') {
if (kwType > KeywordType::None && kwType < KeywordType::Return) {
sc.ChangeState(static_cast<int>(kwType));
} else {
const int chNext = GetDocNextChar(styler, sc, sc.ch == '?');
if (chNext == '(') {
// type method()
// type[] method()
// type<type> method()
if (kwType != KeywordType::Return && (IsIdentifierCharEx(chBefore) || chBefore == ']')) {
sc.ChangeState(SCE_DART_FUNCTION_DEFINITION);
} else {
sc.ChangeState(SCE_DART_FUNCTION);
}
} else if ((chBeforeIdentifier == '<' && (chNext == '>' || chNext == '<'))
|| IsIdentifierStartEx(chNext)) {
// type<type>
// type<type?>
// type<type<type>>
// type<type, type>
// class type implements interface, interface {}
// type identifier
// type? identifier
sc.ChangeState(SCE_DART_CLASS);
}
}
}
if (sc.state != SCE_DART_WORD && sc.ch != '.') {
kwType = KeywordType::None;
}
} break;
}
sc.SetState(SCE_DART_DEFAULT);
}
break;
case SCE_DART_SYMBOL_OPERATOR:
if (!IsDeclarableOperator(sc.ch)) {
sc.SetState(SCE_DART_DEFAULT);
}
break;
case SCE_DART_COMMENTLINE:
case SCE_DART_COMMENTLINEDOC:
if (sc.atLineStart) {
sc.SetState(SCE_DART_DEFAULT);
} else {
HighlightTaskMarker(sc, visibleChars, visibleCharsBefore, SCE_DART_TASKMARKER);
}
break;
case SCE_DART_COMMENTBLOCK:
case SCE_DART_COMMENTBLOCKDOC:
if (sc.Match('*', '/')) {
sc.Forward();
--commentLevel;
if (commentLevel == 0) {
sc.ForwardSetState(SCE_DART_DEFAULT);
}
} else if (sc.Match('/', '*')) {
sc.Forward();
++commentLevel;
} else if (HighlightTaskMarker(sc, visibleChars, visibleCharsBefore, SCE_DART_TASKMARKER)) {
continue;
}
break;
case SCE_DART_STRING_SQ:
case SCE_DART_STRING_DQ:
case SCE_DART_TRIPLE_STRING_SQ:
case SCE_DART_TRIPLE_STRING_DQ:
case SCE_DART_RAWSTRING_SQ:
case SCE_DART_RAWSTRING_DQ:
case SCE_DART_TRIPLE_RAWSTRING_SQ:
case SCE_DART_TRIPLE_RAWSTRING_DQ:
if (sc.atLineStart && !IsTripleString(sc.state)) {
sc.SetState(SCE_DART_DEFAULT);
} else if (sc.ch == '\\' && sc.state < SCE_DART_RAWSTRING_SQ) {
if (escSeq.resetEscapeState(sc.state, sc.chNext)) {
sc.SetState(SCE_DART_ESCAPECHAR);
sc.Forward();
if (sc.Match('u', '{')) {
escSeq.brace = true;
escSeq.digitsLeft = 7; // Unicode code point
sc.Forward();
}
}
} else if (sc.ch == '$' && sc.state < SCE_DART_RAWSTRING_SQ) {
if (sc.chNext == '{' || sc.chNext == '(') {
if (sc.chNext == '(') {
simpleStringInterpolation = true;
escSeq.outerState = sc.state;
} else {
nestedState.push_back(sc.state);
}
sc.SetState(SCE_DART_OPERATOR2);
sc.Forward();
} else if (IsIdentifierStartEx(sc.chNext)) {
escSeq.outerState = sc.state;
sc.SetState(SCE_DART_VARIABLE2);
}
} else if (sc.ch == GetStringQuote(sc.state) && (!IsTripleString(sc.state) || sc.MatchNext())) {
if (IsTripleString(sc.state)) {
//sc.Advance(2);
sc.Forward(2);
}
sc.Forward();
if (sc.state <= SCE_DART_STRING_DQ && (chBefore == ',' || chBefore == '{')) {
const int chNext = GetLineNextChar(styler, sc);
if (chNext == ':') {
sc.ChangeState(SCE_DART_KEY);
}
}
sc.SetState(SCE_DART_DEFAULT);
}
break;
case SCE_DART_ESCAPECHAR:
if (escSeq.atEscapeEnd(sc.ch)) {
if (escSeq.brace && sc.ch == '}') {
sc.Forward();
}
sc.SetState(escSeq.outerState);
continue;
}
break;
}
if (sc.state == SCE_DART_DEFAULT) {
if (sc.ch == '/' && (sc.chNext == '/' || sc.chNext == '*')) {
visibleCharsBefore = visibleChars;
const int chNext = sc.chNext;
sc.SetState((chNext == '/') ? SCE_DART_COMMENTLINE : SCE_DART_COMMENTBLOCK);
sc.Forward(2);
if (sc.ch == chNext && sc.chNext != chNext) {
sc.ChangeState((chNext == '/') ? SCE_DART_COMMENTLINEDOC : SCE_DART_COMMENTBLOCKDOC);
}
if (chNext == '/') {
if (visibleChars == 0) {
lineStateLineType = DartLineStateMaskLineComment;
}
} else {
commentLevel = 1;
}
continue;
}
if (sc.ch == 'r' && (sc.chNext == '\'' || sc.chNext == '"')) {
sc.SetState((sc.chNext == '\'') ? SCE_DART_RAWSTRING_SQ : SCE_DART_RAWSTRING_DQ);
sc.Forward(2);
if (sc.chPrev == '\'' && sc.Match('\'', '\'')) {
sc.ChangeState(SCE_DART_TRIPLE_RAWSTRING_SQ);
sc.Forward(2);
} else if (sc.chPrev == '"' && sc.Match('"', '"')) {
sc.ChangeState(SCE_DART_TRIPLE_RAWSTRING_DQ);
sc.Forward(2);
}
continue;
}
if (sc.ch == '"') {
if (sc.MatchNext('"', '"')) {
sc.SetState(SCE_DART_TRIPLE_STRING_DQ);
//sc.Advance(2);
sc.Forward(2);
} else {
chBefore = chPrevNonWhite;
sc.SetState(SCE_DART_STRING_DQ);
}
} else if (sc.ch == '\'') {
if (sc.MatchNext('\'', '\'')) {
sc.SetState(SCE_DART_TRIPLE_STRING_SQ);
//sc.Advance(2);
sc.Forward(2);
} else {
chBefore = chPrevNonWhite;
sc.SetState(SCE_DART_STRING_SQ);
}
} else if (IsNumberStart(sc.ch, sc.chNext)) {
sc.SetState(SCE_DART_NUMBER);
} else if ((sc.ch == '@' || sc.ch == '$') && IsIdentifierStartEx(sc.chNext)) {
sc.SetState((sc.ch == '@') ? SCE_DART_METADATA : SCE_DART_VARIABLE);
} else if (sc.ch == '#') {
if (IsIdentifierStartEx(sc.chNext)) {
sc.SetState(SCE_DART_SYMBOL_IDENTIFIER);
} else if (IsDeclarableOperator(sc.chNext)) {
sc.SetState(SCE_DART_SYMBOL_OPERATOR);
}
} else if (IsIdentifierStartEx(sc.ch)) {
chBefore = chPrevNonWhite;
if (chPrevNonWhite != '.') {
chBeforeIdentifier = chPrevNonWhite;
}
sc.SetState(SCE_DART_IDENTIFIER);
} else if (IsAGraphic(sc.ch)) {
sc.SetState(SCE_DART_OPERATOR);
if (simpleStringInterpolation && sc.ch == ')') {
simpleStringInterpolation = false;
sc.ChangeState(SCE_DART_OPERATOR2);
sc.ForwardSetState(escSeq.outerState);
continue;
}
if (!nestedState.empty()) {
sc.ChangeState(SCE_DART_OPERATOR2);
if (sc.ch == '{') {
nestedState.push_back(SCE_DART_DEFAULT);
} else if (sc.ch == '}') {
const int outerState = TakeAndPop(nestedState);
sc.ForwardSetState(outerState);
continue;
}
}
}
}
if (!isspacechar(sc.ch)) {
visibleChars++;
if (!IsSpaceEquiv(sc.state)) {
chPrevNonWhite = sc.ch;
}
}
if (sc.atLineEnd) {
int lineState = (commentLevel << 2) | lineStateLineType;
if (!nestedState.empty()) {
lineState |= PackLineState(nestedState) << 8;
}
styler.SetLineState(sc.currentLine, lineState);
lineStateLineType = 0;
visibleChars = 0;
visibleCharsBefore = 0;
kwType = KeywordType::None;
}
sc.Forward();
}
sc.Complete();
}
struct FoldLineState {
int lineComment;
int packageImport;
constexpr explicit FoldLineState(int lineState) noexcept :
lineComment(lineState & DartLineStateMaskLineComment),
packageImport((lineState >> 1) & 1) {
}
};
void SCI_METHOD LexerDart::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int, IDocument* pAccess)
{
if (!options.fold) { return; }
PropSetSimple props;
Accessor styler(pAccess, &props);
//const int foldComment = styler.GetPropertyInt("fold.comment", 1);
//const int foldComment = props.GetInt("fold.comment", 1) != 0;
//const int foldComment = options.foldComment;
const Sci_PositionU endPos = startPos + lengthDoc;
Sci_Position lineCurrent = styler.GetLine(startPos);
FoldLineState foldPrev(0);
int levelCurrent = SC_FOLDLEVELBASE;
if (lineCurrent > 0) {
levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
foldPrev = FoldLineState(styler.GetLineState(lineCurrent - 1));
const Sci_PositionU bracePos = CheckBraceOnNextLine(styler, lineCurrent - 1, SCE_DART_OPERATOR, SCE_DART_TASKMARKER);
if (bracePos) {
startPos = bracePos + 1; // skip the brace
}
}
int levelNext = levelCurrent;
FoldLineState foldCurrent(styler.GetLineState(lineCurrent));
Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
char chNext = styler[startPos];
int styleNext = styler.StyleAt(startPos);
int style = styleNext;
int visibleChars = 0;
while (startPos < endPos) {
const char ch = chNext;
const int stylePrev = style;
style = styleNext;
chNext = styler[++startPos];
styleNext = styler.StyleAt(startPos);
switch (style) {
case SCE_DART_COMMENTBLOCKDOC:
case SCE_DART_COMMENTBLOCK: {
const int level = (ch == '/' && chNext == '*') ? 1 : ((ch == '*' && chNext == '/') ? -1 : 0);
if (level != 0) {
levelNext += level;
startPos++;
chNext = styler[startPos];
styleNext = styler.StyleAt(startPos);
}
} break;
case SCE_DART_TRIPLE_RAWSTRING_SQ:
case SCE_DART_TRIPLE_RAWSTRING_DQ:
case SCE_DART_TRIPLE_STRING_SQ:
case SCE_DART_TRIPLE_STRING_DQ:
if (style != stylePrev) {
levelNext++;
}
if (style != styleNext) {
levelNext--;
}
break;
case SCE_DART_OPERATOR:
case SCE_DART_OPERATOR2:
if (ch == '{' || ch == '[' || ch == '(') {
levelNext++;
} else if (ch == '}' || ch == ']' || ch == ')') {
levelNext--;
}
break;
}
if (visibleChars == 0 && !IsSpaceEquiv(style)) {
++visibleChars;
}
if (startPos == lineStartNext) {
const FoldLineState foldNext(styler.GetLineState(lineCurrent + 1));
levelNext = sci::max(levelNext, SC_FOLDLEVELBASE);
if (foldCurrent.lineComment) {
levelNext += foldNext.lineComment - foldPrev.lineComment;
} else if (foldCurrent.packageImport) {
levelNext += foldNext.packageImport - foldPrev.packageImport;
} else if (visibleChars) {
const Sci_PositionU bracePos = CheckBraceOnNextLine(styler, lineCurrent, SCE_DART_OPERATOR, SCE_DART_TASKMARKER);
if (bracePos) {
levelNext++;
startPos = bracePos + 1; // skip the brace
style = SCE_DART_OPERATOR;
chNext = styler[startPos];
styleNext = styler.StyleAt(startPos);
}
}
const int levelUse = levelCurrent;
int lev = levelUse | levelNext << 16;
if (levelUse < levelNext) {
lev |= SC_FOLDLEVELHEADERFLAG;
}
styler.SetLevel(lineCurrent, lev);
lineCurrent++;
lineStartNext = styler.LineStart(lineCurrent + 1);
lineStartNext = sci::min(lineStartNext, endPos);
levelCurrent = levelNext;
foldPrev = foldCurrent;
foldCurrent = foldNext;
visibleChars = 0;
}
}
}
// ----------------------------------------------------------------------------
extern const LexerModule lmDart(SCLEX_DART, LexerDart::LexerFactoryDart, "Dart", dartWordLists);
// ----------------------------------------------------------------------------

View File

@ -5,7 +5,8 @@ val SCLEX_AHK=200
val SCLEX_CSV=201
val SCLEX_DART=202
val SCLEX_KOTLIN=203
val SCLEX_SYSVERILOG=204
val SCLEX_TOML=204
val SCLEX_SYSVERILOG=205
## -----------------------------------------------------------------------------
@ -34,40 +35,6 @@ val SCE_AHK_VARREFKW=19
val SCE_AHK_ERROR=20
val SCE_DART_DEFAULT=0
val SCE_DART_COMMENTLINE=1
val SCE_DART_COMMENTLINEDOC=2
val SCE_DART_COMMENTBLOCK=3
val SCE_DART_COMMENTBLOCKDOC=4
val SCE_DART_TASKMARKER=5
val SCE_DART_VARIABLE2=6
val SCE_DART_VARIABLE=7
val SCE_DART_IDENTIFIER=8
val SCE_DART_SYMBOL_IDENTIFIER=9
val SCE_DART_METADATA=10
val SCE_DART_STRING_SQ=11
val SCE_DART_STRING_DQ=12
val SCE_DART_TRIPLE_STRING_SQ=13
val SCE_DART_TRIPLE_STRING_DQ=14
val SCE_DART_RAWSTRING_SQ=15
val SCE_DART_RAWSTRING_DQ=16
val SCE_DART_TRIPLE_RAWSTRING_SQ=17
val SCE_DART_TRIPLE_RAWSTRING_DQ=18
val SCE_DART_ESCAPECHAR=19
val SCE_DART_OPERATOR=20
val SCE_DART_OPERATOR2=21
val SCE_DART_NUMBER=22
val SCE_DART_SYMBOL_OPERATOR=23
val SCE_DART_LABEL=24
val SCE_DART_FUNCTION=25
val SCE_DART_FUNCTION_DEFINITION=26
val SCE_DART_WORD=27
val SCE_DART_WORD2=28
val SCE_DART_CLASS=29
val SCE_DART_ENUM=30
val SCE_DART_KEY=31
# Lexical states for SCLEX_KOTLIN
lex Kotlin=SCLEX_KOTLIN SCE_KOTLIN_
val SCE_KOTLIN_DEFAULT=0

View File

@ -5,9 +5,8 @@
#define SCLEX_AHK 200
#define SCLEX_CSV 201
#define SCLEX_DART 202
#define SCLEX_KOTLIN 203
#define SCLEX_SYSVERILOG 204
#define SCLEX_KOTLIN 202
#define SCLEX_SYSVERILOG 203
// -----------------------------------------------------------------------------
// !!!!! ADD Lexer Linkage in: scintilla\src\Catalogue.cxx !!!!!
@ -49,40 +48,6 @@
#define SCE_CSV_COLUMN_9 10
#define SCE_DART_DEFAULT 0
#define SCE_DART_COMMENTLINE 1
#define SCE_DART_COMMENTLINEDOC 2
#define SCE_DART_COMMENTBLOCK 3
#define SCE_DART_COMMENTBLOCKDOC 4
#define SCE_DART_TASKMARKER 5
#define SCE_DART_VARIABLE2 6
#define SCE_DART_VARIABLE 7
#define SCE_DART_IDENTIFIER 8
#define SCE_DART_SYMBOL_IDENTIFIER 9
#define SCE_DART_METADATA 10
#define SCE_DART_STRING_SQ 11
#define SCE_DART_STRING_DQ 12
#define SCE_DART_TRIPLE_STRING_SQ 13
#define SCE_DART_TRIPLE_STRING_DQ 14
#define SCE_DART_RAWSTRING_SQ 15
#define SCE_DART_RAWSTRING_DQ 16
#define SCE_DART_TRIPLE_RAWSTRING_SQ 17
#define SCE_DART_TRIPLE_RAWSTRING_DQ 18
#define SCE_DART_ESCAPECHAR 19
#define SCE_DART_OPERATOR 20
#define SCE_DART_OPERATOR2 21
#define SCE_DART_NUMBER 22
#define SCE_DART_SYMBOL_OPERATOR 23
#define SCE_DART_LABEL 24
#define SCE_DART_FUNCTION 25
#define SCE_DART_FUNCTION_DEFINITION 26
#define SCE_DART_WORD 27
#define SCE_DART_WORD2 28
#define SCE_DART_CLASS 29
#define SCE_DART_ENUM 30
#define SCE_DART_KEY 31
#define SCE_KOTLIN_DEFAULT 0
#define SCE_KOTLIN_COMMENTLINE 1
#define SCE_KOTLIN_COMMENTLINEDOC 2

View File

@ -20,7 +20,7 @@ namespace {
const int catRanges[] = {
//++Autogenerated -- start of section automatically generated
// Created with Python 3.12.0, Unicode 15.0.0
// Created with Python 3.13.0, Unicode 15.1.0
25,
1046,
1073,
@ -2255,7 +2255,6 @@ const int catRanges[] = {
385045,
391901,
392725,
393117,
393238,
393265,
393365,
@ -2319,6 +2318,7 @@ const int catRanges[] = {
406532,
407573,
408733,
409077,
409092,
409621,
410621,
@ -4012,6 +4012,8 @@ const int catRanges[] = {
5887069,
5887492,
6126653,
6127108,
6147037,
6225924,
6243293,
6291460,

View File

@ -29,10 +29,12 @@ bool LexAccessor::MatchIgnoreCase(Sci_Position pos, const char *s) {
return true;
}
void LexAccessor::GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len) {
void LexAccessor::GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len) const {
assert(s);
assert(startPos_ <= endPos_ && len != 0);
memset(s, '\0', len);
endPos_ = std::min(endPos_, startPos_ + len - 1);
endPos_ = std::min(endPos_, static_cast<Sci_PositionU>(lenDoc));
len = endPos_ - startPos_;
if (startPos_ >= static_cast<Sci_PositionU>(startPos) && endPos_ <= static_cast<Sci_PositionU>(endPos)) {
const char * const p = buf + (startPos_ - startPos);
@ -40,10 +42,9 @@ void LexAccessor::GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_, char
} else {
pAccess->GetCharRange(s, startPos_, len);
}
s[len] = '\0';
}
void LexAccessor::GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len) {
void LexAccessor::GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len) const {
assert(s);
GetRange(startPos_, endPos_, s, len);
while (*s) {
@ -54,16 +55,18 @@ void LexAccessor::GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_
}
}
std::string LexAccessor::GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_) {
std::string LexAccessor::GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_) const {
assert(startPos_ < endPos_);
endPos_ = std::min(endPos_, static_cast<Sci_PositionU>(lenDoc));
const Sci_PositionU len = endPos_ - startPos_;
std::string s(len, '\0');
GetRange(startPos_, endPos_, s.data(), len + 1);
return s;
}
std::string LexAccessor::GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_) {
std::string LexAccessor::GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_) const {
assert(startPos_ < endPos_);
endPos_ = std::min(endPos_, static_cast<Sci_PositionU>(lenDoc));
const Sci_PositionU len = endPos_ - startPos_;
std::string s(len, '\0');
GetRangeLowered(startPos_, endPos_, s.data(), len + 1);

View File

@ -116,11 +116,11 @@ public:
bool MatchIgnoreCase(Sci_Position pos, const char *s);
// Get first len - 1 characters in range [startPos_, endPos_).
void GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len);
void GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len);
void GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len) const;
void GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_, char *s, Sci_PositionU len) const;
// Get all characters in range [startPos_, endPos_).
std::string GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_);
std::string GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_);
std::string GetRange(Sci_PositionU startPos_, Sci_PositionU endPos_) const;
std::string GetRangeLowered(Sci_PositionU startPos_, Sci_PositionU endPos_) const;
char StyleAt(Sci_Position position) const {
return pAccess->StyleAt(position);

View File

@ -66,15 +66,15 @@ bool StyleContext::MatchIgnoreCase(const char *s) {
return true;
}
void StyleContext::GetCurrent(char *s, Sci_PositionU len) {
void StyleContext::GetCurrent(char *s, Sci_PositionU len) const {
styler.GetRange(styler.GetStartSegment(), currentPos, s, len);
}
void StyleContext::GetCurrentLowered(char *s, Sci_PositionU len) {
void StyleContext::GetCurrentLowered(char *s, Sci_PositionU len) const {
styler.GetRangeLowered(styler.GetStartSegment(), currentPos, s, len);
}
void StyleContext::GetCurrentString(std::string &string, Transform transform) {
void StyleContext::GetCurrentString(std::string &string, Transform transform) const {
const Sci_PositionU startPos = styler.GetStartSegment();
const Sci_PositionU len = currentPos - styler.GetStartSegment();
string.resize(len);

View File

@ -183,10 +183,10 @@ public:
}
// Non-inline
bool MatchIgnoreCase(const char *s);
void GetCurrent(char *s, Sci_PositionU len);
void GetCurrentLowered(char *s, Sci_PositionU len);
void GetCurrent(char *s, Sci_PositionU len) const;
void GetCurrentLowered(char *s, Sci_PositionU len) const;
enum class Transform { none, lower };
void GetCurrentString(std::string &string, Transform transform);
void GetCurrentString(std::string &string, Transform transform) const;
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
@ -205,8 +205,6 @@ public:
}
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
};
}

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>

View File

@ -158,11 +158,13 @@
B32D4A2A9CEC222A5140E99F /* LexFSharp.cxx in Sources */ = {isa = PBXBuildFile; fileRef = F8E54626B22BD9493090F40B /* LexFSharp.cxx */; };
3D044C4CA34C6FD7E58E0091 /* LexTOML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 42BC44CCB57D4E78DEE6E358 /* LexTOML.cxx */; };
14314DCD945FDA90481F0A0D /* LexTroff.cxx in Sources */ = {isa = PBXBuildFile; fileRef = D2EF4913B8F91656C787F584 /* LexTroff.cxx */; };
F8754555AADD2CADCFE8EA15 /* LexAHK.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1AA04301A03118C21CFFFB2C /* LexAHK.cxx */; };
DB844F40914139A6CC0F0B9D /* LexCSV.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 7BC94C09A2DD758D153753EA /* LexCSV.cxx */; };
4A6347E7A998AE4182AEC307 /* LexDart.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 5A504DA19D5986EE9678A6A3 /* LexDart.cxx */; };
D5EB42F0B025D1A5D9739B63 /* LexerUtils.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 3D6F475C856AB2CE3EDD1C62 /* LexerUtils.cxx */; };
6EA944558619A402F54729F7 /* LexKotlin.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 9ED648E296FFC45EBF80368D /* LexKotlin.cxx */; };
0DFB4F5F94B018794ADB389D /* LexDart.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1F274010A7943C43BA265511 /* LexDart.cxx */; };
CEC8496B8D9712E6EEDBC301 /* LexZig.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 71684CF6BCC80369BCE2F893 /* LexZig.cxx */; };
4A444CF5A75E52E2C5537328 /* LexNix.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 81E2488CB0A0DC6B67AA08DD /* LexNix.cxx */; };
BB044596AE5BF36880B8B4AE /* LexAHK.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 62E346ACA93C6685F7D1173B /* LexAHK.cxx */; };
939949838A31265F78C59DB4 /* LexCSV.cxx in Sources */ = {isa = PBXBuildFile; fileRef = B85A474396AEFA29F274960F /* LexCSV.cxx */; };
775B43F7A841DE6F76D670E2 /* LexerUtils.cxx in Sources */ = {isa = PBXBuildFile; fileRef = D50442879C41BD2B219ECCFA /* LexerUtils.cxx */; };
A9604C459C5401B68E91D6C1 /* LexKotlin.cxx in Sources */ = {isa = PBXBuildFile; fileRef = BA174A3A9F378A665382BA40 /* LexKotlin.cxx */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -319,11 +321,13 @@
F8E54626B22BD9493090F40B /* LexFSharp.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexFSharp.cxx; path = ../../lexers/LexFSharp.cxx; sourceTree = SOURCE_ROOT; };
42BC44CCB57D4E78DEE6E358 /* LexTOML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTOML.cxx; path = ../../lexers/LexTOML.cxx; sourceTree = SOURCE_ROOT; };
D2EF4913B8F91656C787F584 /* LexTroff.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTroff.cxx; path = ../../lexers/LexTroff.cxx; sourceTree = SOURCE_ROOT; };
1AA04301A03118C21CFFFB2C /* LexAHK.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAHK.cxx; path = ../../lexers/LexAHK.cxx; sourceTree = SOURCE_ROOT; };
7BC94C09A2DD758D153753EA /* LexCSV.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCSV.cxx; path = ../../lexers/LexCSV.cxx; sourceTree = SOURCE_ROOT; };
5A504DA19D5986EE9678A6A3 /* LexDart.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDart.cxx; path = ../../lexers/LexDart.cxx; sourceTree = SOURCE_ROOT; };
3D6F475C856AB2CE3EDD1C62 /* LexerUtils.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerUtils.cxx; path = ../../lexers/LexerUtils.cxx; sourceTree = SOURCE_ROOT; };
9ED648E296FFC45EBF80368D /* LexKotlin.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexKotlin.cxx; path = ../../lexers/LexKotlin.cxx; sourceTree = SOURCE_ROOT; };
1F274010A7943C43BA265511 /* LexDart.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDart.cxx; path = ../../lexers/LexDart.cxx; sourceTree = SOURCE_ROOT; };
71684CF6BCC80369BCE2F893 /* LexZig.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexZig.cxx; path = ../../lexers/LexZig.cxx; sourceTree = SOURCE_ROOT; };
81E2488CB0A0DC6B67AA08DD /* LexNix.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNix.cxx; path = ../../lexers/LexNix.cxx; sourceTree = SOURCE_ROOT; };
62E346ACA93C6685F7D1173B /* LexAHK.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAHK.cxx; path = ../../lexers/LexAHK.cxx; sourceTree = SOURCE_ROOT; };
B85A474396AEFA29F274960F /* LexCSV.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCSV.cxx; path = ../../lexers/LexCSV.cxx; sourceTree = SOURCE_ROOT; };
D50442879C41BD2B219ECCFA /* LexerUtils.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerUtils.cxx; path = ../../lexers/LexerUtils.cxx; sourceTree = SOURCE_ROOT; };
BA174A3A9F378A665382BA40 /* LexKotlin.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexKotlin.cxx; path = ../../lexers/LexKotlin.cxx; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -371,7 +375,7 @@
28BA730624E34D9400272C2D /* LexA68k.cxx */,
28BA72EE24E34D9300272C2D /* LexAbaqus.cxx */,
28BA730024E34D9400272C2D /* LexAda.cxx */,
1AA04301A03118C21CFFFB2C /* LexAHK.cxx */,
62E346ACA93C6685F7D1173B /* LexAHK.cxx */,
28BA72DF24E34D9200272C2D /* LexAPDL.cxx */,
3AF14420BFC43876F16C5995 /* LexAsciidoc.cxx */,
28BA72FF24E34D9400272C2D /* LexAsm.cxx */,
@ -397,9 +401,9 @@
28BA730124E34D9400272C2D /* LexCrontab.cxx */,
28BA731524E34D9500272C2D /* LexCsound.cxx */,
28BA732924E34D9600272C2D /* LexCSS.cxx */,
7BC94C09A2DD758D153753EA /* LexCSV.cxx */,
B85A474396AEFA29F274960F /* LexCSV.cxx */,
28BA72E024E34D9200272C2D /* LexD.cxx */,
5A504DA19D5986EE9678A6A3 /* LexDart.cxx */,
1F274010A7943C43BA265511 /* LexDart.cxx */,
28BA732C24E34D9600272C2D /* LexDataflex.cxx */,
28BA72DD24E34D9200272C2D /* LexDiff.cxx */,
28BA732024E34D9600272C2D /* LexDMAP.cxx */,
@ -409,7 +413,7 @@
28BA72D924E34D9200272C2D /* LexEiffel.cxx */,
28BA72E824E34D9200272C2D /* LexErlang.cxx */,
28BA72EB24E34D9300272C2D /* LexErrorList.cxx */,
3D6F475C856AB2CE3EDD1C62 /* LexerUtils.cxx */,
D50442879C41BD2B219ECCFA /* LexerUtils.cxx */,
28BA72F624E34D9300272C2D /* LexEScript.cxx */,
28BA72EC24E34D9300272C2D /* LexFlagship.cxx */,
28BA72CB24E34D9100272C2D /* LexForth.cxx */,
@ -427,7 +431,7 @@
28BA733024E34D9600272C2D /* LexJSON.cxx */,
315E4E969868C52C125686B2 /* LexJulia.cxx */,
28BA731124E34D9500272C2D /* LexKix.cxx */,
9ED648E296FFC45EBF80368D /* LexKotlin.cxx */,
BA174A3A9F378A665382BA40 /* LexKotlin.cxx */,
28BA72F824E34D9300272C2D /* LexKVIrc.cxx */,
28BA72ED24E34D9300272C2D /* LexLaTeX.cxx */,
28BA72E424E34D9200272C2D /* LexLisp.cxx */,
@ -446,6 +450,7 @@
28BA72E124E34D9200272C2D /* LexMySQL.cxx */,
28BA72D324E34D9200272C2D /* LexNim.cxx */,
28BA733624E34D9700272C2D /* LexNimrod.cxx */,
81E2488CB0A0DC6B67AA08DD /* LexNix.cxx */,
28BA72F424E34D9300272C2D /* LexNsis.cxx */,
28BA731424E34D9500272C2D /* LexNull.cxx */,
28BA731824E34D9500272C2D /* LexOpal.cxx */,
@ -493,6 +498,7 @@
28BA731E24E34D9500272C2D /* LexVisualProlog.cxx */,
28BA730A24E34D9400272C2D /* LexX12.cxx */,
28BA72E724E34D9200272C2D /* LexYAML.cxx */,
71684CF6BCC80369BCE2F893 /* LexZig.cxx */,
);
name = Lexers;
sourceTree = "<group>";
@ -752,11 +758,13 @@
00D544CC992062D2E3CD4BF6 /* LexGDScript.cxx in Sources */,
3D044C4CA34C6FD7E58E0091 /* LexTOML.cxx in Sources */,
14314DCD945FDA90481F0A0D /* LexTroff.cxx in Sources */,
F8754555AADD2CADCFE8EA15 /* LexAHK.cxx in Sources */,
DB844F40914139A6CC0F0B9D /* LexCSV.cxx in Sources */,
4A6347E7A998AE4182AEC307 /* LexDart.cxx in Sources */,
D5EB42F0B025D1A5D9739B63 /* LexerUtils.cxx in Sources */,
6EA944558619A402F54729F7 /* LexKotlin.cxx in Sources */,
0DFB4F5F94B018794ADB389D /* LexDart.cxx in Sources */,
CEC8496B8D9712E6EEDBC301 /* LexZig.cxx in Sources */,
4A444CF5A75E52E2C5537328 /* LexNix.cxx in Sources */,
BB044596AE5BF36880B8B4AE /* LexAHK.cxx in Sources */,
939949838A31265F78C59DB4 /* LexCSV.cxx in Sources */,
775B43F7A841DE6F76D670E2 /* LexerUtils.cxx in Sources */,
A9604C459C5401B68E91D6C1 /* LexKotlin.cxx in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -820,7 +828,6 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
"OTHER_LDFLAGS[arch=*]" = "-Wl,-ld_classic";
SDKROOT = macosx;
};
name = Debug;
@ -876,7 +883,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.13;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
"OTHER_LDFLAGS[arch=*]" = "-Wl,-ld_classic";
SDKROOT = macosx;
};
name = Release;
@ -886,7 +892,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5.4.0;
CURRENT_PROJECT_VERSION = 5.4.1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4F446KW87E;
DYLIB_COMPATIBILITY_VERSION = 1;
@ -914,7 +920,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5.4.0;
CURRENT_PROJECT_VERSION = 5.4.1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4F446KW87E;
DYLIB_COMPATIBILITY_VERSION = 1;

View File

@ -4,8 +4,8 @@
#include <windows.h>
#define VERSION_LEXILLA "5.4.0"
#define VERSION_WORDS 5, 4, 0, 0
#define VERSION_LEXILLA "5.4.1"
#define VERSION_WORDS 5, 4, 1, 0
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_WORDS

View File

@ -239,6 +239,20 @@ $(DIR_O)/LexD.o: \
../lexlib/LexerModule.h \
../lexlib/OptionSet.h \
../lexlib/DefaultLexer.h
$(DIR_O)/LexDart.o: \
../lexers/LexDart.cxx \
../../scintilla/include/ILexer.h \
../../scintilla/include/Sci_Position.h \
../../scintilla/include/Scintilla.h \
../include/SciLexer.h \
../lexlib/WordList.h \
../lexlib/LexAccessor.h \
../lexlib/Accessor.h \
../lexlib/StyleContext.h \
../lexlib/CharacterSet.h \
../lexlib/LexerModule.h \
../lexlib/OptionSet.h \
../lexlib/DefaultLexer.h
$(DIR_O)/LexDiff.o: \
../lexers/LexDiff.cxx \
../../scintilla/include/ILexer.h \
@ -655,26 +669,6 @@ $(DIR_O)/LexCSV.o: \
../lexlib/CharacterSet.h \
../lexers_x/SciXLexer.h \
../include/SciLexer.h
$(DIR_O)/LexDart.o: \
../lexers_x/LexDart.cxx \
../../scintilla/include/ILexer.h \
../../scintilla/include/Sci_Position.h \
../../scintilla/include/Scintilla.h \
../lexlib/StringCopy.h \
../lexlib/PropSetSimple.h \
../lexlib/LexAccessor.h \
../lexlib/Accessor.h \
../lexlib/StyleContext.h \
../lexlib/LexerModule.h \
../lexlib/DefaultLexer.h \
../lexlib/OptionSet.h \
../lexlib/WordList.h \
../lexers_x/CharSetX.h \
../lexlib/CharacterSet.h \
../lexers_x/SciXLexer.h \
../include/SciLexer.h \
../lexers_x/StringUtils.h \
../lexers_x/LexerUtils.h
$(DIR_O)/LexerUtils.o: \
../lexers_x/LexerUtils.cxx \
../../scintilla/include/Scintilla.h \

View File

@ -95,6 +95,7 @@ LEX_OBJS=\
$(DIR_O)\LexCPP.obj \
$(DIR_O)\LexCSS.obj \
$(DIR_O)\LexD.obj \
$(DIR_O)\LexDart.obj \
$(DIR_O)\LexDiff.obj \
$(DIR_O)\LexFortran.obj \
$(DIR_O)\LexHTML.obj \
@ -126,7 +127,6 @@ LEX_OBJS=\
$(DIR_O)\LexYAML.obj \
$(DIR_O)\LexAHK.obj \
$(DIR_O)\LexCSV.obj \
$(DIR_O)\LexDart.obj \
$(DIR_O)\LexerUtils.obj \
$(DIR_O)\LexJSON.obj \
$(DIR_O)\LexKotlin.obj \

View File

@ -239,6 +239,20 @@ $(DIR_O)/LexD.obj: \
../lexlib/LexerModule.h \
../lexlib/OptionSet.h \
../lexlib/DefaultLexer.h
$(DIR_O)/LexDart.obj: \
../lexers/LexDart.cxx \
../../scintilla/include/ILexer.h \
../../scintilla/include/Sci_Position.h \
../../scintilla/include/Scintilla.h \
../include/SciLexer.h \
../lexlib/WordList.h \
../lexlib/LexAccessor.h \
../lexlib/Accessor.h \
../lexlib/StyleContext.h \
../lexlib/CharacterSet.h \
../lexlib/LexerModule.h \
../lexlib/OptionSet.h \
../lexlib/DefaultLexer.h
$(DIR_O)/LexDiff.obj: \
../lexers/LexDiff.cxx \
../../scintilla/include/ILexer.h \
@ -655,26 +669,6 @@ $(DIR_O)/LexCSV.obj: \
../lexlib/CharacterSet.h \
../lexers_x/SciXLexer.h \
../include/SciLexer.h
$(DIR_O)/LexDart.obj: \
../lexers_x/LexDart.cxx \
../../scintilla/include/ILexer.h \
../../scintilla/include/Sci_Position.h \
../../scintilla/include/Scintilla.h \
../lexlib/StringCopy.h \
../lexlib/PropSetSimple.h \
../lexlib/LexAccessor.h \
../lexlib/Accessor.h \
../lexlib/StyleContext.h \
../lexlib/LexerModule.h \
../lexlib/DefaultLexer.h \
../lexlib/OptionSet.h \
../lexlib/WordList.h \
../lexers_x/CharSetX.h \
../lexlib/CharacterSet.h \
../lexers_x/SciXLexer.h \
../include/SciLexer.h \
../lexers_x/StringUtils.h \
../lexers_x/LexerUtils.h
$(DIR_O)/LexerUtils.obj: \
../lexers_x/LexerUtils.cxx \
../../scintilla/include/Scintilla.h \

View File

@ -1 +1 @@
540
541

View File

@ -40,27 +40,22 @@ KEYWORDLIST KeyWords_Dart =
EDITLEXER lexDart =
{
SCLEX_DART, "Dart", IDS_LEX_DART_SRC, L"Dart Source Code", L"dart", L"",
SCLEX_DART, "dart", IDS_LEX_DART_SRC, L"Dart Source Code", L"dart", L"",
&KeyWords_Dart,{
{ {STYLE_DEFAULT}, IDS_LEX_STR_Default, L"Default", L"", L"" },
//{ {SCE_DART_DEFAULT}, IDS_LEX_STR_Default, L"Default", L"", L"" },
{ {SCE_DART_WORD}, IDS_LEX_STR_Keyword, L"Keyword", L"fore:#0000FF", L"" },
{ {SCE_DART_WORD2}, IDS_LEX_STR_Keyword2nd, L"Keyword 2nd", L"fore:#0000FF", L"" },
{ {SCE_DART_KW_PRIMARY}, IDS_LEX_STR_Keyword, L"Keyword", L"fore:#0000FF", L"" },
{ {MULTI_STYLE(SCE_DART_IDENTIFIER, SCE_DART_IDENTIFIER_STRING, 0, 0)}, IDS_LEX_STR_Identifier, L"Identifier", L"", L"" },
{ {MULTI_STYLE(SCE_DART_KW_SECONDARY, SCE_DART_KW_TERTIARY, SCE_DART_KW_TYPE, 0)}, IDS_LEX_STR_Keyword2nd, L"Keyword 2nd", L"fore:#0000FF", L"" },
{ {SCE_DART_METADATA}, IDS_LEX_STR_63383, L"Meta-Data", L"fore:#FF8000", L"" },
{ {SCE_DART_CLASS}, IDS_LEX_STR_63258, L"Class", L"fore:#0080FF", L"" },
{ {SCE_DART_ENUM}, IDS_LEX_STR_Enum, L"Enumeration", L"fore:#FF8000", L"" },
{ {SCE_DART_FUNCTION}, IDS_LEX_STR_63277, L"Function", L"fore:#A46000", L"" },
{ {MULTI_STYLE(SCE_DART_COMMENTBLOCK, SCE_DART_COMMENTLINE, 0, 0)}, IDS_LEX_STR_Comment, L"Comment", L"fore:#608060", L"" },
{ {MULTI_STYLE(SCE_DART_COMMENTBLOCKDOC, SCE_DART_COMMENTLINEDOC, 0, 0)}, IDS_LEX_STR_63259, L"Comment Doc", L"fore:#408040", L"" },
{ {SCE_DART_TASKMARKER}, IDS_LEX_STR_63373, L"Task Marker", L"bold; fore:#408080" },
{ {MULTI_STYLE(SCE_DART_STRING_SQ, SCE_DART_STRING_DQ, 0, 0)}, IDS_LEX_STR_String, L"String", L"fore:#008000", L"" },
{ {MULTI_STYLE(SCE_DART_TRIPLE_STRING_SQ, SCE_DART_TRIPLE_STRING_DQ, 0, 0)}, IDS_LEX_STR_63385, L"TriQ-String", L"fore:#F08000", L"" },
{ {MULTI_STYLE(SCE_DART_RAWSTRING_SQ, SCE_DART_RAWSTRING_DQ, SCE_DART_TRIPLE_RAWSTRING_SQ, SCE_DART_TRIPLE_RAWSTRING_DQ)}, IDS_LEX_STR_VerbStrg, L"Verbatim String", L"fore:#F08000", L"" },
{ {SCE_DART_ESCAPECHAR}, IDS_LEX_STR_63366, L"ESC Sequence", L"fore:#0080C0", L"" },
{ {SCE_DART_LABEL}, IDS_LEX_STR_Label, L"Label", L"fore:#7C5AF3", L"" },
{ {SCE_DART_NUMBER}, IDS_LEX_STR_Number, L"Number", L"fore:#FF0000", L"" },
{ {SCE_DART_VARIABLE}, IDS_LEX_STR_Var, L"Variable", L"fore:#9E4D2A", L"" },
{ {MULTI_STYLE(SCE_DART_OPERATOR, SCE_DART_OPERATOR2, 0, 0)}, IDS_LEX_STR_Operator, L"Operator", L"fore:#B000B0", L"" },
{ {MULTI_STYLE(SCE_DART_OPERATOR, SCE_DART_OPERATOR_STRING, 0, 0)}, IDS_LEX_STR_Operator, L"Operator", L"fore:#B000B0", L"" },
{ {SCE_DART_SYMBOL_IDENTIFIER}, IDS_LEX_STR_63386, L"Symbol Identifier", L"fore:#7C5AF3", L"" },
{ {SCE_DART_SYMBOL_OPERATOR}, IDS_LEX_STR_63387, L"Symbol Operator", L"fore:#7C5AF3", L"" },
EDITLEXER_SENTINEL

View File

@ -86,7 +86,11 @@ inline LPCWSTR _Win10BuildToReleaseId(const DWORD build)
if (build >= 22000) { // Win11
if (build >= 22631)
if (build >= 26100)
{
lpcReleaseID = L"24H2";
}
else if (build >= 22631)
{
lpcReleaseID = L"23H2";
}