Skip to content

Commit

Permalink
[Nim] Allow trailing quotes in triple-quoted string.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Aug 16, 2024
1 parent 6d99c0b commit 31a5f65
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scintilla/lexers/LexNim.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct EscapeSequence {
// highlight any character as escape sequence.
void resetEscapeState(int state, int chNext) noexcept {
outerState = state;
digitsLeft = 0;
digitsLeft = 1;
hex = true;
brace = false;
if (chNext == 'x') {
Expand All @@ -57,8 +57,6 @@ struct EscapeSequence {
} else if (IsADigit(chNext)) {
digitsLeft = 7;
hex = false;
} else {
digitsLeft = 1;
}
}
void resetEscapeState(int state) noexcept {
Expand Down Expand Up @@ -259,7 +257,10 @@ void ColouriseNimDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty
sc.Forward();
} else if (sc.state < SCE_NIM_TRIPLE_STRING || sc.MatchNext('\"', '\"')) {
if (sc.state >= SCE_NIM_TRIPLE_STRING) {
sc.Forward(2);
// quotes except last three are string content
while (sc.chNext == '\"') {
sc.Forward();
}
}
sc.ForwardSetState(SCE_NIM_DEFAULT);
}
Expand Down

0 comments on commit 31a5f65

Please sign in to comment.