Skip to content

Commit

Permalink
[Rust] Highlight (raw) C string literals.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Aug 25, 2024
1 parent 00149c9 commit 25dcd80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion scintilla/lexers/LexAviSynth.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void ColouriseAvsDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSty
insideScript = 0;
}
} else if (sc.Match('e', '\"')) {
// Avisynth+ 3.6 escaped string
// AviSynth+ 3.6 escaped string
sc.SetState(SCE_AVS_ESCAPESTRING);
sc.Forward();
} else if (IsNumberStart(sc.ch, sc.chNext) || (sc.ch == '$' && IsHexDigit(sc.chNext))) {
Expand Down
18 changes: 9 additions & 9 deletions scintilla/lexers/LexRust.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,16 @@ void ColouriseRustDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initSt
hashCount = 0;
sc.SetState(SCE_RUST_RAW_STRING);
sc.Forward();
} else if (sc.Match('b', '\"')) {
sc.SetState(SCE_RUST_BYTESTRING);
sc.Forward();
} else if (sc.Match('b', '\'')) {
sc.SetState(SCE_RUST_BYTE_CHARACTER);
sc.Forward();
} else if (sc.Match('b', 'r')) {
if (IsRustRawString(styler, sc.currentPos + 2, true, hashCount)) {
sc.SetState(SCE_RUST_RAW_BYTESTRING);
} else if (sc.ch == 'b' || sc.ch == 'c') {
if (sc.chNext == '\"') {
sc.SetState((sc.ch == 'b') ? SCE_RUST_BYTESTRING : SCE_RUST_STRING);
sc.Forward();
} else if (sc.chNext == 'r' && IsRustRawString(styler, sc.currentPos + 2, true, hashCount)) {
sc.SetState((sc.ch == 'b') ? SCE_RUST_RAW_BYTESTRING : SCE_RUST_RAW_STRING);
sc.Advance(hashCount + 2);
} else if (sc.Match('b', '\'')) {
sc.SetState(SCE_RUST_BYTE_CHARACTER);
sc.Forward();
} else {
if (sc.chPrev != '.') {
chBeforeIdentifier = sc.chPrev;
Expand Down

0 comments on commit 25dcd80

Please sign in to comment.