@@ -163,6 +163,7 @@ LexicalClass lexicalClasses[] = {
163163 15 , " SCE_ZIG_KW_TERTIARY" , " identifier" , " Tertiary keywords" ,
164164 16 , " SCE_ZIG_KW_TYPE" , " identifier" , " Global types" ,
165165 17 , " SCE_ZIG_IDENTIFIER_STRING" , " identifier" , " Identifier using @\"\" syntax" ,
166+ 18 , " SCE_ZIG_STRINGEOL" , " error literal string" , " End of line where string is not closed" ,
166167};
167168
168169class LexerZig : public DefaultLexer {
@@ -262,6 +263,10 @@ void LexerZig::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle
262263 int lineState = 0 ;
263264 EscapeSequence escSeq;
264265
266+ if (initStyle == SCE_ZIG_STRINGEOL) {
267+ initStyle = SCE_ZIG_DEFAULT;
268+ }
269+
265270 StyleContext sc (startPos, lengthDoc, initStyle, styler);
266271
267272 while (sc.More ()) {
@@ -311,6 +316,8 @@ void LexerZig::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle
311316 case SCE_ZIG_IDENTIFIER_STRING:
312317 if (sc.atLineStart ) {
313318 sc.SetState (SCE_ZIG_DEFAULT);
319+ } else if (sc.atLineEnd && sc.state != SCE_ZIG_MULTISTRING) {
320+ sc.ChangeState (SCE_ZIG_STRINGEOL);
314321 } else if (sc.ch == ' \\ ' && sc.state != SCE_ZIG_MULTISTRING) {
315322 escSeq.resetEscapeState (sc.state , sc.chNext );
316323 sc.SetState (SCE_ZIG_ESCAPECHAR);
@@ -326,6 +333,12 @@ void LexerZig::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle
326333 }
327334 break ;
328335
336+ case SCE_ZIG_STRINGEOL:
337+ if (sc.atLineStart ) {
338+ sc.SetState (SCE_ZIG_DEFAULT);
339+ }
340+ break ;
341+
329342 case SCE_ZIG_ESCAPECHAR:
330343 if (escSeq.atEscapeEnd (sc.ch )) {
331344 if (escSeq.brace && sc.ch == ' }' ) {
0 commit comments