Skip to content

Commit

Permalink
[Ruby] Allow non-ASCII character as heredoc delimiter initial character.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Apr 3, 2024
1 parent 57e32fc commit c0a97f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scintilla/lexers/LexRuby.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, LexAccessor &styler) {
j += 1;
}

if (isSafeAlnum(styler[j])) {
if (isSafeAlnumOrHigh(styler[j])) {
// Init target_end because some compilers think it won't
// be initialized by the time it's used
target_start = target_end = j;
Expand All @@ -571,7 +571,7 @@ bool sureThisIsNotHeredoc(Sci_Position lt2StartPos, LexAccessor &styler) {
return definitely_not_a_here_doc;
}
for (; j < lengthDoc; j++) {
if (!isSafeAlnum(styler[j])) {
if (!isSafeAlnumOrHigh(styler[j])) {
if (target_quote && styler[j] != target_quote) {
// unquoted end
return definitely_not_a_here_doc;
Expand Down Expand Up @@ -887,7 +887,7 @@ void ColouriseRbDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
chNext = chNext2;
styler.ColorTo(i + 1, SCE_RB_OPERATOR);

if (!(AnyOf(chNext2, '\"', '\'', '`', '-', '~') || isSafeAlpha(chNext2))) {
if (!(AnyOf(chNext2, '\"', '\'', '`', '-', '~') || isSafeAlphaOrHigh(chNext2))) {
// It's definitely not a here-doc,
// based on Ruby's lexer/parser in the
// heredoc_identifier routine.
Expand Down

0 comments on commit c0a97f2

Please sign in to comment.