diff --git a/lexilla/include/LexicalStyles.iface b/lexilla/include/LexicalStyles.iface index a1f4697ac..4771e5f84 100644 --- a/lexilla/include/LexicalStyles.iface +++ b/lexilla/include/LexicalStyles.iface @@ -149,6 +149,7 @@ val SCLEX_TROFF=137 val SCLEX_DART=138 val SCLEX_ZIG=139 val SCLEX_NIX=140 +val SCLEX_SINEX=141 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -1769,7 +1770,6 @@ val SCE_MARKDOWN_LINK=18 val SCE_MARKDOWN_CODE=19 val SCE_MARKDOWN_CODE2=20 val SCE_MARKDOWN_CODEBK=21 -val SCE_MARKDOWN_HDRTEXT=22 # Lexical state for SCLEX_TXT2TAGS lex Txt2tags=SCLEX_TXT2TAGS SCE_TXT2TAGS_ val SCE_TXT2TAGS_DEFAULT=0 @@ -2451,3 +2451,11 @@ val SCE_NIX_KEYWORD2=13 val SCE_NIX_KEYWORD3=14 val SCE_NIX_KEYWORD4=15 val SCE_NIX_STRINGEOL=16 +# Lexical states for SCLEX_SINEX +lex Sinex=SCLEX_SINEX SCE_SINEX_ +val SCE_SINEX_DEFAULT=0 +val SCE_SINEX_COMMENTLINE=1 +val SCE_SINEX_BLOCK_START=2 +val SCE_SINEX_BLOCK_END=3 +val SCE_SINEX_DATE=4 +val SCE_SINEX_NUMBER=5 diff --git a/lexilla/include/SciLexer.h b/lexilla/include/SciLexer.h index f6f39716a..b37f0d091 100644 --- a/lexilla/include/SciLexer.h +++ b/lexilla/include/SciLexer.h @@ -1,19 +1,20 @@ /* Scintilla source code edit control */ /** @file SciLexer.h - ** Interface to the added lexer functions in the SciLexer version of the edit control. + ** Interface to the lexer functions in Lexilla. + ** File called SciLexer.h ro retain compatibility with client code. **/ /* Copyright 1998-2002 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ -/* Most of this file is automatically generated from the Scintilla.iface interface definition - * file which contains any comments about the definitions. HFacer.py does the generation. */ +/* Most of this file is automatically generated from the LexicalStyles.iface interface definition + * file. LexFacer.py does the generation. */ #ifndef SCILEXER_H #define SCILEXER_H -/* SciLexer features - not in standard Scintilla */ +/* Lexilla features */ -/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ +/* ++Autogenerated -- start of section automatically generated from LexicalStyles.iface */ #define SCLEX_CONTAINER 0 #define SCLEX_NULL 1 #define SCLEX_PYTHON 2 @@ -153,6 +154,7 @@ #define SCLEX_DART 138 #define SCLEX_ZIG 139 #define SCLEX_NIX 140 +#define SCLEX_SINEX 141 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 @@ -1578,7 +1580,6 @@ #define SCE_MARKDOWN_CODE 19 #define SCE_MARKDOWN_CODE2 20 #define SCE_MARKDOWN_CODEBK 21 -#define SCE_MARKDOWN_HDRTEXT 22 #define SCE_TXT2TAGS_DEFAULT 0 #define SCE_TXT2TAGS_LINE_BEGIN 1 #define SCE_TXT2TAGS_STRONG1 2 @@ -2189,6 +2190,12 @@ #define SCE_NIX_KEYWORD3 14 #define SCE_NIX_KEYWORD4 15 #define SCE_NIX_STRINGEOL 16 -/* --Autogenerated -- end of section automatically generated from Scintilla.iface */ +#define SCE_SINEX_DEFAULT 0 +#define SCE_SINEX_COMMENTLINE 1 +#define SCE_SINEX_BLOCK_START 2 +#define SCE_SINEX_BLOCK_END 3 +#define SCE_SINEX_DATE 4 +#define SCE_SINEX_NUMBER 5 +/* --Autogenerated -- end of section automatically generated from LexicalStyles.iface */ #endif diff --git a/lexilla/lexers/LexAU3.cxx b/lexilla/lexers/LexAU3.cxx index 95e123458..4813a62c2 100644 --- a/lexilla/lexers/LexAU3.cxx +++ b/lexilla/lexers/LexAU3.cxx @@ -79,12 +79,12 @@ static inline bool IsTypeCharacter(const int ch) } static inline bool IsAWordChar(const int ch) { - return ((IsASCII(ch) && isalnum(ch)) || ch == '_'); + return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(const int ch) { - return ((IsASCII(ch) && isalnum(ch)) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.'); + return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.'); } static inline bool IsAOperator(char ch) { @@ -143,7 +143,7 @@ static int GetSendKey(const char *szLine, char *szKey) // Save second portion into var... szSpecial[nSpecPos++] = cTemp; // check if Second portion is all numbers for repeat fuction - if (isdigit(cTemp & 0xFF) == false) {nSpecNum = 0;} + if (isdigit(cTemp) == false) {nSpecNum = 0;} } } nPos++; // skip to next char diff --git a/lexilla/lexers/LexAVS.cxx b/lexilla/lexers/LexAVS.cxx index f5dc19fc2..60cb97289 100644 --- a/lexilla/lexers/LexAVS.cxx +++ b/lexilla/lexers/LexAVS.cxx @@ -30,17 +30,18 @@ using namespace Lexilla; static inline bool IsAWordChar(const int ch) { - return IsASCII(ch) && (isalnum(ch) || ch == '_'); + return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(int ch) { - return isalpha(ch & 0xFF) || (ch != ' ' && ch != '\n' && ch != '(' && ch != '.' && ch != ','); + return isalpha(ch) || (ch != ' ' && ch != '\n' && ch != '(' && ch != '.' && ch != ','); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. - return IsASCII(ch) && (isdigit(ch) || ch == '.' || ch == '-' || ch == '+'); + return (ch < 0x80) && + (isdigit(ch) || ch == '.' || ch == '-' || ch == '+'); } static void ColouriseAvsDoc( diff --git a/lexilla/lexers/LexCPP.cxx b/lexilla/lexers/LexCPP.cxx index ddc23b023..a0fc71dba 100644 --- a/lexilla/lexers/LexCPP.cxx +++ b/lexilla/lexers/LexCPP.cxx @@ -528,7 +528,7 @@ const LexicalClass lexicalClasses[] = { 27, "SCE_C_ESCAPESEQUENCE", "literal string escapesequence", "Escape sequence", }; -constexpr int sizeLexicalClasses{ static_cast(std::size(lexicalClasses)) }; +constexpr int sizeLexicalClasses = static_cast(std::size(lexicalClasses)); } diff --git a/lexilla/lexers/LexCSS.cxx b/lexilla/lexers/LexCSS.cxx index 5444e7db6..76ae62c83 100644 --- a/lexilla/lexers/LexCSS.cxx +++ b/lexilla/lexers/LexCSS.cxx @@ -44,11 +44,11 @@ static inline bool IsAWordChar(const unsigned int ch) { * Unfortunately, we are only getting string bytes here, and not full unicode characters. We cannot guarantee * that our byte is between U+0080 - U+00A0 (to return false), so we have to allow all characters U+0080 and higher */ - return ch >= 0x80 || isalnum(ch & 0xFF) || ch == '-' || ch == '_'; + return ch >= 0x80 || isalnum(ch) || ch == '-' || ch == '_'; } inline bool IsCssOperator(const int ch) { - if (!(IsASCII(ch) && isalnum(ch)) && + if (!((ch < 0x80) && isalnum(ch)) && (ch == '{' || ch == '}' || ch == ':' || ch == ',' || ch == ';' || ch == '.' || ch == '#' || ch == '!' || ch == '@' || /* CSS2 */ diff --git a/lexilla/lexers/LexCoffeeScript.cxx b/lexilla/lexers/LexCoffeeScript.cxx index 59372c594..95f0adb1d 100644 --- a/lexilla/lexers/LexCoffeeScript.cxx +++ b/lexilla/lexers/LexCoffeeScript.cxx @@ -249,7 +249,7 @@ static void ColouriseCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length sc.SetState(SCE_COFFEESCRIPT_DEFAULT); } else if (sc.ch == '/') { sc.Forward(); - while (IsASCII(sc.ch) && islower(sc.ch)) + while ((sc.ch < 0x80) && islower(sc.ch)) sc.Forward(); // gobble regex flags sc.SetState(SCE_COFFEESCRIPT_DEFAULT); } else if (sc.ch == '\\') { diff --git a/lexilla/lexers/LexD.cxx b/lexilla/lexers/LexD.cxx index b3786c005..ba76e6c7e 100644 --- a/lexilla/lexers/LexD.cxx +++ b/lexilla/lexers/LexD.cxx @@ -234,7 +234,10 @@ Sci_Position SCI_METHOD LexerD::WordListSet(int n, const char *wl) { } Sci_Position firstModification = -1; if (wordListN) { - if (wordListN->Set(wl)) { + WordList wlNew; + wlNew.Set(wl); + if (*wordListN != wlNew) { + wordListN->Set(wl); firstModification = 0; } } diff --git a/lexilla/lexers/LexInno.cxx b/lexilla/lexers/LexInno.cxx index 6781e36ca..91e110675 100644 --- a/lexilla/lexers/LexInno.cxx +++ b/lexilla/lexers/LexInno.cxx @@ -89,6 +89,7 @@ static void ColouriseInnoDoc(Sci_PositionU startPos, Sci_Position length, int, W // using the hand-written state machine shown below styler.StartAt(startPos); styler.StartSegment(startPos); + for (Sci_Position i = startPos; i < lengthDoc; i++) { chPrev = ch; ch = chNext; diff --git a/lexilla/lexers/LexMatlab.cxx b/lexilla/lexers/LexMatlab.cxx index 2d0a562fb..9517bd4e6 100644 --- a/lexilla/lexers/LexMatlab.cxx +++ b/lexilla/lexers/LexMatlab.cxx @@ -242,7 +242,7 @@ static void ColouriseMatlabOctaveDoc( sc.SetState(SCE_MATLAB_DEFAULT); } } else if (sc.state == SCE_MATLAB_KEYWORD) { - if (!isalnum(sc.ch & 0xFF) && sc.ch != '_') { + if (!isalnum(sc.ch) && sc.ch != '_') { char s[100]; sc.GetCurrent(s, sizeof(s)); bool notKeyword = false; @@ -302,7 +302,7 @@ static void ColouriseMatlabOctaveDoc( styler.SetLineState(curLine, ComposeLineState( commentDepth, foldingLevel, expectingArgumentsBlock, inClassScope, inArgumentsScope)); } else if (sc.state == SCE_MATLAB_NUMBER) { - if (!isdigit(sc.ch & 0xFF) && sc.ch != '.' + if (!isdigit(sc.ch) && sc.ch != '.' && !(sc.ch == 'e' || sc.ch == 'E') && !((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')) && !(((sc.ch == 'x' || sc.ch == 'X') && sc.chPrev == '0') || (sc.ch >= 'a' && sc.ch <= 'f') || (sc.ch >= 'A' && sc.ch <= 'F')) @@ -394,9 +394,9 @@ static void ColouriseMatlabOctaveDoc( } } else if (sc.ch == '"') { sc.SetState(SCE_MATLAB_DOUBLEQUOTESTRING); - } else if (isdigit(sc.ch & 0xFF) || (sc.ch == '.' && isdigit(sc.chNext & 0xFF))) { + } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { sc.SetState(SCE_MATLAB_NUMBER); - } else if (isalpha(sc.ch & 0xFF)) { + } else if (isalpha(sc.ch)) { sc.SetState(SCE_MATLAB_KEYWORD); } else if (isoperator(static_cast(sc.ch)) || sc.ch == '@' || sc.ch == '\\') { if (sc.ch == '(' || sc.ch == '[' || sc.ch == '{') { diff --git a/lexilla/lexers/LexPython.cxx b/lexilla/lexers/LexPython.cxx index edaf87daa..8e1deb918 100644 --- a/lexilla/lexers/LexPython.cxx +++ b/lexilla/lexers/LexPython.cxx @@ -54,6 +54,9 @@ namespace { The PEP for f-strings is at https://www.python.org/dev/peps/pep-0498/ */ +/* t-string are lexed identically to f-strings and use the stack of state values + and the lexer states for f-strings +*/ struct SingleFStringExpState { int state; int nestingCount; @@ -62,7 +65,7 @@ struct SingleFStringExpState { /* kwCDef, kwCTypeName only used for Cython */ enum kwType { kwOther, kwClass, kwDef, kwImport, kwCDef, kwCTypeName, kwCPDef }; -enum literalsAllowed { litNone = 0, litU = 1, litB = 2, litF = 4 }; +enum literalsAllowed { litNone = 0, litU = 1, litB = 2, litF = 4, litT = 8 }; constexpr int indicatorWhitespace = 1; @@ -74,7 +77,8 @@ constexpr bool IsPyStringTypeChar(int ch, literalsAllowed allowed) noexcept { return ((allowed & litB) && (ch == 'b' || ch == 'B')) || ((allowed & litU) && (ch == 'u' || ch == 'U')) || - ((allowed & litF) && (ch == 'f' || ch == 'F')); + ((allowed & litF) && (ch == 'f' || ch == 'F')) || + ((allowed & litT) && (ch == 't' || ch == 'T')); } constexpr bool IsQuote(int ch) { @@ -88,7 +92,7 @@ constexpr bool IsRawPrefix(int ch) { bool IsPyStringStart(int ch, int chNext, int chNext2, literalsAllowed allowed) noexcept { // To cover both python2 and python3 lex character prefixes as -- // ur'' is a string, but ru'' is not - // fr'', rf'', br'', rb'' are all strings + // fr'', rf'', br'', rb'', tr'', rt'' are all strings if (IsQuote(ch)) return true; if (IsPyStringTypeChar(ch, allowed)) { @@ -163,14 +167,14 @@ int GetPyStringState(Accessor &styler, Sci_Position i, Sci_PositionU *nextIndex, if (IsRawPrefix(ch)) { i++; if (IsPyStringTypeChar(chNext, allowed)) { - if (AnyOf(chNext, 'f', 'F')) + if (AnyOf(chNext, 'f', 'F', 't', 'T')) isFString = true; i++; } ch = styler.SafeGetCharAt(i); chNext = styler.SafeGetCharAt(i + 1); } else if (IsPyStringTypeChar(ch, allowed)) { - if (AnyOf(ch, 'f', 'F')) + if (AnyOf(ch, 'f', 'F', 't', 'T')) isFString = true; if (IsRawPrefix(chNext)) i += 2; @@ -291,6 +295,7 @@ struct OptionsPython { bool stringsU = true; bool stringsB = true; bool stringsF = true; + bool stringsT = true; bool stringsOverNewline = false; bool keywords2NoSubIdentifiers = false; bool fold = false; @@ -307,6 +312,8 @@ struct OptionsPython { allowedLiterals = static_cast(allowedLiterals | litB); if (stringsF) allowedLiterals = static_cast(allowedLiterals | litF); + if (stringsT) + allowedLiterals = static_cast(allowedLiterals | litT); return allowedLiterals; } }; @@ -343,6 +350,9 @@ struct OptionSetPython : public OptionSet { DefineProperty("lexer.python.strings.f.pep.701", &OptionsPython::pep701StringsF, "Set to 0 to use pre-PEP 701 / Python 3.12 f-string lexing."); + DefineProperty("lexer.python.strings.t", &OptionsPython::stringsT, + "Set to 0 to not recognise Python 3.14 t-string literals t\"var={var}\"."); + DefineProperty("lexer.python.strings.over.newline", &OptionsPython::stringsOverNewline, "Set to 1 to allow strings to span newline characters."); diff --git a/lexilla/lexers/LexRegistry.cxx b/lexilla/lexers/LexRegistry.cxx index ac08feb1e..adc4210ec 100644 --- a/lexilla/lexers/LexRegistry.cxx +++ b/lexilla/lexers/LexRegistry.cxx @@ -36,7 +36,7 @@ using namespace Scintilla; using namespace Lexilla; static const char *const RegistryWordListDesc[] = { - nullptr + 0 }; struct OptionsRegistry { @@ -250,7 +250,7 @@ void SCI_METHOD LexerRegistry::Lex(Sci_PositionU startPos, } if (context.state == SCE_REG_STRING && context.ch == '%' && - (isdigit(context.chNext & 0xFF) || context.chNext == '*')) { + (isdigit(context.chNext) || context.chNext == '*')) { context.SetState(SCE_REG_PARAMETER); } } @@ -337,7 +337,7 @@ void SCI_METHOD LexerRegistry::Lex(Sci_PositionU startPos, afterEqualSign = true; highlight = true; } else if (afterEqualSign) { - bool wordStart = isalpha(context.ch & 0xFF) && !isalpha(context.chPrev & 0xFF); + bool wordStart = isalpha(context.ch) && !isalpha(context.chPrev); if (wordStart && AtValueType(styler, currPos)) { context.SetState(SCE_REG_VALUETYPE); } diff --git a/lexilla/lexers/LexRuby.cxx b/lexilla/lexers/LexRuby.cxx index 294349c66..47d5e3564 100644 --- a/lexilla/lexers/LexRuby.cxx +++ b/lexilla/lexers/LexRuby.cxx @@ -75,7 +75,7 @@ bool isSafeWordcharOrHigh(char ch) noexcept { // Error: scintilla's KeyWords.h includes '.' as a word-char // we want to separate things that can take methods from the // methods. - return isHighBitChar(ch) || isalnum(ch & 0xFF) || ch == '_'; + return isHighBitChar(ch) || isalnum(ch) || ch == '_'; } constexpr bool isWhiteSpace(char ch) noexcept { diff --git a/lexilla/lexers/LexRust.cxx b/lexilla/lexers/LexRust.cxx index 8569ddefc..2e69832c4 100644 --- a/lexilla/lexers/LexRust.cxx +++ b/lexilla/lexers/LexRust.cxx @@ -7,12 +7,12 @@ // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -93,7 +93,7 @@ static const char * const rustWordLists[NUM_RUST_KEYWORD_LISTS + 1] = { "Keywords 5", "Keywords 6", "Keywords 7", - 0, + nullptr, }; struct OptionSetRust : public OptionSet { @@ -131,12 +131,42 @@ struct OptionSetRust : public OptionSet { } }; +const LexicalClass lexicalClasses[] = { + // Lexer rust SCLEX_RUST SCE_RUST_: + 0, "SCE_RUST_DEFAULT", "default", "White space", + 1, "SCE_RUST_COMMENTBLOCK", "comment", "Comment", + 2, "SCE_RUST_COMMENTLINE", "comment line", "Line comment", + 3, "SCE_RUST_COMMENTBLOCKDOC", "comment documentation", "Doc comment", + 4, "SCE_RUST_COMMENTLINEDOC", "comment documentation line", "Doc comment line", + 5, "SCE_RUST_NUMBER", "literal numeric", "Number", + 6, "SCE_RUST_WORD", "keyword", "Keywords", + 7, "SCE_RUST_WORD2", "identifier", "Keywords 2", + 8, "SCE_RUST_WORD3", "identifier", "Keywords 3", + 9, "SCE_RUST_WORD4", "identifier", "Keywords 4", + 10, "SCE_RUST_WORD5", "identifier", "Keywords 5", + 11, "SCE_RUST_WORD6", "identifier", "Keywords 6", + 12, "SCE_RUST_WORD7", "identifier", "Keywords 7", + 13, "SCE_RUST_STRING", "literal string", "Regular string", + 14, "SCE_RUST_STRINGR", "literal string raw", "Raw string", + 15, "SCE_RUST_CHARACTER", "literal string character", "Character", + 16, "SCE_RUST_OPERATOR", "operator", "Operator", + 17, "SCE_RUST_IDENTIFIER", "identifier", "Identifier", + 18, "SCE_RUST_LIFETIME", "annotation", "Lifetime", + 19, "SCE_RUST_MACRO", "macro preprocessor", "Macro", + 20, "SCE_RUST_LEXERROR", "error", "Lexical error", + 21, "SCE_RUST_BYTESTRING", "literal string", "Byte string", + 22, "SCE_RUST_BYTESTRINGR", "literal string raw", "Raw byte string", + 23, "SCE_RUST_BYTECHARACTER", "literal string character", "Byte character", + 24, "SCE_RUST_CSTRING", "literal string", "C string", + 25, "SCE_RUST_CSTRINGR", "literal string raw", "Raw C string", +}; + class LexerRust : public DefaultLexer { WordList keywords[NUM_RUST_KEYWORD_LISTS]; OptionsRust options; OptionSetRust osRust; public: - LexerRust() : DefaultLexer("rust", SCLEX_RUST) { + LexerRust() : DefaultLexer("rust", SCLEX_RUST, lexicalClasses, std::size(lexicalClasses)) { } virtual ~LexerRust() { } @@ -166,7 +196,7 @@ public: 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; void * SCI_METHOD PrivateCall(int, void *) override { - return 0; + return nullptr; } static ILexer5 *LexerFactoryRust() { return new LexerRust(); diff --git a/lexilla/lexers/LexTCL.cxx b/lexilla/lexers/LexTCL.cxx index d52ef7978..691d79e35 100644 --- a/lexilla/lexers/LexTCL.cxx +++ b/lexilla/lexers/LexTCL.cxx @@ -31,11 +31,11 @@ using namespace Lexilla; // Extended to accept accented characters static inline bool IsAWordChar(int ch) { return ch >= 0x80 || - (isalnum(ch & 0xFF) || ch == '_' || ch ==':' || ch=='.'); // : name space separator + (isalnum(ch) || ch == '_' || ch ==':' || ch=='.'); // : name space separator } static inline bool IsAWordStart(int ch) { - return ch >= 0x80 || (ch ==':' || isalpha(ch & 0xFF) || ch == '_'); + return ch >= 0x80 || (ch ==':' || isalpha(ch) || ch == '_'); } static inline bool IsANumberChar(int ch) { @@ -48,7 +48,6 @@ static inline bool IsANumberChar(int ch) { static void ColouriseTCLDoc(Sci_PositionU startPos, Sci_Position length, int , WordList *keywordlists[], Accessor &styler) { #define isComment(s) (s==SCE_TCL_COMMENT || s==SCE_TCL_COMMENTLINE || s==SCE_TCL_COMMENT_BOX || s==SCE_TCL_BLOCK_COMMENT) - const bool fold = (styler.GetPropertyInt("fold") != 0); const bool foldComment = styler.GetPropertyInt("fold.comment") != 0; const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool commentLevel = false; @@ -86,8 +85,7 @@ static void ColouriseTCLDoc(Sci_PositionU startPos, Sci_Position length, int , W currentLevel = styler.LevelAt(currentLine - 1) >> 17; commentLevel = (styler.LevelAt(currentLine - 1) >> 16) & 1; } else - if (fold) { styler.SetLevel(0, SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG); } - + styler.SetLevel(0, SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG); bool visibleChars = false; int previousLevel = currentLevel; @@ -209,10 +207,8 @@ next: flag = SC_FOLDLEVELWHITEFLAG; if (currentLevel > previousLevel) flag = SC_FOLDLEVELHEADERFLAG; - - if (fold) { - styler.SetLevel(currentLine, flag + previousLevel + SC_FOLDLEVELBASE + (currentLevel << 17) + (commentLevel << 16)); - } + styler.SetLevel(currentLine, flag + previousLevel + SC_FOLDLEVELBASE + (currentLevel << 17) + (commentLevel << 16)); + // Update the line state, so it can be seen by next line if (sc.state == SCE_TCL_IN_QUOTE) { lineState = LS_OPEN_DOUBLE_QUOTE; diff --git a/lexilla/lexers/LexVHDL.cxx b/lexilla/lexers/LexVHDL.cxx index aacc83309..89b93ef88 100644 --- a/lexilla/lexers/LexVHDL.cxx +++ b/lexilla/lexers/LexVHDL.cxx @@ -43,12 +43,12 @@ static void ColouriseVHDLDoc( /***************************************/ static inline bool IsAWordChar(const int ch) { - return IsASCII(ch) && (isalnum(ch) || ch == '.' || ch == '_' ); + return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' ); } /***************************************/ static inline bool IsAWordStart(const int ch) { - return IsASCII(ch) && (isalnum(ch) || ch == '_'); + return (ch < 0x80) && (isalnum(ch) || ch == '_'); } /***************************************/ @@ -235,9 +235,8 @@ static void FoldNoBoxVHDLDoc( // Decided it would be smarter to have the lexer have all keywords included. Therefore I // don't check if the style for the keywords that I use to adjust the levels. char words[] = - "architecture begin block case component configuration context else elsif end entity for function " - "generate if loop package procedure process protected record then units view when"; - + "architecture begin block case component else elsif end entity for generate loop package process record then " + "procedure protected function when units"; WordList keywords; keywords.Set(words); diff --git a/lexilla/lexlib/CharacterCategory.cxx b/lexilla/lexlib/CharacterCategory.cxx index d8177bff5..64feb3e46 100644 --- a/lexilla/lexlib/CharacterCategory.cxx +++ b/lexilla/lexlib/CharacterCategory.cxx @@ -20,7 +20,7 @@ namespace { const int catRanges[] = { //++Autogenerated -- start of section automatically generated -// Created with Python 3.13.0, Unicode 15.1.0 +// Created with Python 3.14.0, Unicode 16.0.0 25, 1046, 1073, @@ -754,7 +754,7 @@ const int catRanges[] = { 70141, 70170, 70237, -70405, +70373, 70660, 71971, 72005, @@ -1425,13 +1425,13 @@ const int catRanges[] = { 223334, 223396, 223677, +223697, 223752, 224081, 224309, 224613, 224917, 225201, -225277, 225285, 225350, 225380, @@ -1469,7 +1469,9 @@ const int catRanges[] = { 233219, 233425, 233473, -233789, +233760, +233793, +233853, 233984, 235389, 235424, @@ -1948,7 +1950,7 @@ const int catRanges[] = { 292501, 293778, 293973, -296189, +296285, 296981, 297341, 297994, @@ -2317,7 +2319,7 @@ const int catRanges[] = { 406229, 406532, 407573, -408733, +408797, 409077, 409092, 409621, @@ -2586,7 +2588,9 @@ const int catRanges[] = { 1374465, 1374496, 1374529, -1374589, +1374560, +1374625, +1374685, 1374720, 1374753, 1374813, @@ -2597,7 +2601,10 @@ const int catRanges[] = { 1374945, 1374976, 1375009, -1375069, +1375040, +1375073, +1375104, +1375165, 1375811, 1375904, 1375937, @@ -3003,6 +3010,8 @@ const int catRanges[] = { 2144093, 2144097, 2144189, +2144260, +2145949, 2146308, 2156285, 2156548, @@ -3116,6 +3125,19 @@ const int catRanges[] = { 2204957, 2205192, 2205533, +2205704, +2206020, +2206147, +2206180, +2206208, +2206941, +2207013, +2207180, +2207203, +2207233, +2207965, +2208210, +2208285, 2214922, 2215933, 2215940, @@ -3125,7 +3147,9 @@ const int catRanges[] = { 2217437, 2217476, 2217565, -2219941, +2218052, +2218173, +2219909, 2220036, 2220970, 2221284, @@ -3281,6 +3305,37 @@ const int catRanges[] = { 2256317, 2256389, 2256573, +2256900, +2257245, +2257252, +2257309, +2257348, +2257405, +2257412, +2258653, +2258660, +2258694, +2258789, +2259005, +2259014, +2259069, +2259110, +2259165, +2259174, +2259325, +2259334, +2259397, +2259430, +2259461, +2259492, +2259525, +2259556, +2259601, +2259677, +2259697, +2259773, +2260005, +2260093, 2260996, 2262694, 2262789, @@ -3351,9 +3406,13 @@ const int catRanges[] = { 2283357, 2283528, 2283869, +2284040, +2284701, 2285572, 2286461, 2286501, +2286534, +2286565, 2286598, 2286661, 2286790, @@ -3442,6 +3501,11 @@ const int catRanges[] = { 2318141, 2318353, 2318685, +2324484, +2325553, +2325597, +2326024, +2326365, 2326532, 2326845, 2326852, @@ -3523,7 +3587,8 @@ const int catRanges[] = { 2353221, 2353265, 2353672, -2354013, +2353989, +2354045, 2356740, 2356797, 2357258, @@ -3549,8 +3614,16 @@ const int catRanges[] = { 2525220, 2525413, 2525917, +2526212, +2654077, 2654212, 2672893, +2891780, +2892741, +2893126, +2893221, +2893320, +2893661, 2949124, 2967357, 2967556, @@ -3583,6 +3656,12 @@ const int catRanges[] = { 2977565, 2977700, 2978333, +2992131, +2992228, +2993507, +2993585, +2993672, +2994013, 3000320, 3001345, 3002378, @@ -3608,7 +3687,7 @@ const int catRanges[] = { 3211037, 3211268, 3250909, -3252228, +3252196, 3252541, 3538435, 3538589, @@ -3641,6 +3720,11 @@ const int catRanges[] = { 3642353, 3642394, 3642525, +3768341, +3776008, +3776349, +3776533, +3790493, 3792901, 3794397, 3794437, @@ -3825,6 +3909,13 @@ const int catRanges[] = { 3972485, 3972616, 3972957, +3979780, +3980741, +3980804, +3980840, +3981181, +3981297, +3981341, 3996676, 3996925, 3996932, @@ -3977,7 +4068,9 @@ const int catRanges[] = { 4133397, 4134365, 4134421, -4134493, +4134813, +4134933, +4135005, 4136981, 4147869, 4148245, @@ -3985,21 +4078,18 @@ const int catRanges[] = { 4148757, 4149181, 4149269, -4149565, -4149781, -4151261, -4151285, -4151517, +4149597, +4149749, +4151549, 4151765, -4152221, -4152341, -4152637, +4152253, +4152309, +4152669, 4152853, 4153149, 4153365, 4158077, 4158101, -4159869, 4161032, 4161373, 4194308, diff --git a/lexilla/version.txt b/lexilla/version.txt index e953fd4ef..64ae95986 100644 --- a/lexilla/version.txt +++ b/lexilla/version.txt @@ -1 +1 @@ -545 \ No newline at end of file +546 \ No newline at end of file