diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h index f9a4f67ab9..2ab4e42052 100644 --- a/scintilla/include/SciLexer.h +++ b/scintilla/include/SciLexer.h @@ -1840,17 +1840,18 @@ #define SCE_ZIG_NUMBER 5 #define SCE_ZIG_OPERATOR 6 #define SCE_ZIG_CHARACTER 7 -#define SCE_ZIG_STRING 8 -#define SCE_ZIG_MULTISTRING 9 -#define SCE_ZIG_ESCAPECHAR 10 -#define SCE_ZIG_FORMAT_SPECIFIER 11 -#define SCE_ZIG_PLACEHOLDER 12 -#define SCE_ZIG_IDENTIFIER 13 -#define SCE_ZIG_BUILTIN_FUNCTION 14 -#define SCE_ZIG_WORD 15 -#define SCE_ZIG_TYPE 16 -#define SCE_ZIG_FUNCTION 17 -#define SCE_ZIG_FUNCTION_DEFINITION 18 +#define SCE_ZIG_IDENTIFIER_STRING 8 +#define SCE_ZIG_STRING 9 +#define SCE_ZIG_MULTISTRING 10 +#define SCE_ZIG_ESCAPECHAR 11 +#define SCE_ZIG_FORMAT_SPECIFIER 12 +#define SCE_ZIG_PLACEHOLDER 13 +#define SCE_ZIG_IDENTIFIER 14 +#define SCE_ZIG_BUILTIN_FUNCTION 15 +#define SCE_ZIG_WORD 16 +#define SCE_ZIG_TYPE 17 +#define SCE_ZIG_FUNCTION 18 +#define SCE_ZIG_FUNCTION_DEFINITION 19 #define SCE_MATHEMATICA_DEFAULT 0 #define SCE_MATHEMATICA_COMMENTLINE 1 #define SCE_MATHEMATICA_COMMENT 2 diff --git a/scintilla/include/SciLexer.iface b/scintilla/include/SciLexer.iface index c2dd4721c5..aa96571880 100644 --- a/scintilla/include/SciLexer.iface +++ b/scintilla/include/SciLexer.iface @@ -3150,6 +3150,7 @@ val SCE_ZIG_TASKMARKER= val SCE_ZIG_NUMBER= val SCE_ZIG_OPERATOR= val SCE_ZIG_CHARACTER= +val SCE_ZIG_IDENTIFIER_STRING= val SCE_ZIG_STRING= val SCE_ZIG_MULTISTRING= val SCE_ZIG_ESCAPECHAR= diff --git a/scintilla/lexers/LexZig.cxx b/scintilla/lexers/LexZig.cxx index f536180d61..cac7e80083 100644 --- a/scintilla/lexers/LexZig.cxx +++ b/scintilla/lexers/LexZig.cxx @@ -200,6 +200,7 @@ void ColouriseZigDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty break; case SCE_ZIG_CHARACTER: + case SCE_ZIG_IDENTIFIER_STRING: case SCE_ZIG_STRING: case SCE_ZIG_MULTISTRING: if (sc.atLineStart) { @@ -213,9 +214,10 @@ void ColouriseZigDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty escSeq.digitsLeft = 9; sc.Forward(); } - } else if ((sc.ch == '\'' && sc.state == SCE_ZIG_CHARACTER) || (sc.ch == '\"' && sc.state == SCE_ZIG_STRING)) { + } else if ((sc.ch == '\'' && sc.state == SCE_ZIG_CHARACTER) + || (sc.ch == '\"' && (sc.state == SCE_ZIG_STRING || sc.state == SCE_ZIG_IDENTIFIER_STRING))) { sc.ForwardSetState(SCE_ZIG_DEFAULT); - } else if (sc.state != SCE_ZIG_CHARACTER) { + } else if (sc.state >= SCE_ZIG_STRING) { if (sc.ch == '{' || sc.ch == '}') { if (sc.ch == sc.chNext) { escSeq.resetEscapeState(sc.state); @@ -306,6 +308,9 @@ void ColouriseZigDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty sc.SetState(SCE_ZIG_CHARACTER); } else if (IsADigit(sc.ch)) { sc.SetState(SCE_ZIG_NUMBER); + } else if (sc.Match('@', '\"')) { + sc.SetState(SCE_ZIG_IDENTIFIER_STRING); + sc.Forward(); } else if ((sc.ch == '@' && IsIdentifierStartEx(sc.chNext)) || IsIdentifierStartEx(sc.ch)) { sc.SetState((sc.ch == '@') ? SCE_ZIG_BUILTIN_FUNCTION : SCE_ZIG_IDENTIFIER); } else if (IsAGraphic(sc.ch)) { diff --git a/src/EditLexers/stlZig.cpp b/src/EditLexers/stlZig.cpp index 0a0b56e6c5..fe9ad72c48 100644 --- a/src/EditLexers/stlZig.cpp +++ b/src/EditLexers/stlZig.cpp @@ -30,7 +30,7 @@ static EDITSTYLE Styles_Zig[] = { { SCE_ZIG_FUNCTION, NP2StyleX_Function, L"fore:#A46000" }, { SCE_ZIG_COMMENTLINE, NP2StyleX_Comment, L"fore:#608060" }, { MULTI_STYLE(SCE_ZIG_COMMENTLINEDOC, SCE_ZIG_COMMENTLINETOP, 0, 0), NP2StyleX_DocComment, L"fore:#408040" }, - { MULTI_STYLE(SCE_ZIG_CHARACTER, SCE_ZIG_STRING, 0, 0), NP2StyleX_String, L"fore:#008000" }, + { MULTI_STYLE(SCE_ZIG_CHARACTER, SCE_ZIG_STRING, SCE_ZIG_IDENTIFIER_STRING, 0), NP2StyleX_String, L"fore:#008000" }, { SCE_ZIG_MULTISTRING, NP2StyleX_RawString, L"fore:#008080" }, { SCE_ZIG_ESCAPECHAR, NP2StyleX_EscapeSequence, L"fore:#0080C0" }, { SCE_ZIG_FORMAT_SPECIFIER, NP2StyleX_FormatSpecifier, L"fore:#7C5AF3" },