Skip to content

Commit

Permalink
[Batch] Allow non-ASCII character in label, discussion #903.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Nov 2, 2024
1 parent 21e552b commit 151b9ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scintilla/lexers/LexBatch.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ constexpr bool IsFileNameChar(int ch) noexcept {
constexpr bool IsLabelStart(int ch) noexcept {
// ! is not allowed with SetLocal EnableDelayedExpansion
//return !AnyOf(ch, '\r', '\n', ' ', '\t', '|', '&', '%', '!', ',', ';', '=', '+', '<', '>');
return IsIdentifierChar(ch) || ch == '.' || ch == '-';
return IsIdentifierCharEx(ch) || ch == '.' || ch == '-';
}

constexpr bool IsLabelChar(int ch) noexcept {
//return !AnyOf(ch, '\r', '\n', ' ', '\t', '|', '&', '%', '!', ',', ';', '=');
return IsIdentifierChar(ch) || ch == '.' || ch == '-';
return IsIdentifierCharEx(ch) || ch == '.' || ch == '-';
}

constexpr bool IsVariableChar(int ch, char quote, Command command, int parenCount) noexcept {
Expand Down Expand Up @@ -373,7 +373,7 @@ void ColouriseBatchDoc(Sci_PositionU startPos, Sci_Position lengthDoc, int initS
// https://ss64.com/nt/goto.html
if (sc.atLineStart) {
sc.SetState(SCE_BAT_DEFAULT);
} else if (IsGraphic(sc.ch) && !(IsAGraphic(sc.chPrev) && IsLabelChar(sc.ch))) {
} else if (IsGraphic(sc.ch) && !(IsGraphic(sc.chPrev) && IsLabelChar(sc.ch))) {
if (outerStyle == SCE_BAT_NOT_BATCH) {
sc.ChangeState(SCE_BAT_NOT_BATCH);
labelLine = false;
Expand Down

0 comments on commit 151b9ec

Please sign in to comment.