2022-01-04 23:07:50 +00:00
|
|
|
// Scintilla source code edit control
|
|
|
|
/** @file LexBash.cxx
|
|
|
|
** Lexer for Bash.
|
|
|
|
**/
|
|
|
|
// Copyright 2004-2012 by Neil Hodgson <neilh@scintilla.org>
|
|
|
|
// Adapted from LexPerl by Kein-Hong Man 2004
|
|
|
|
// The License.txt file describes the conditions under which this software may be distributed.
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <cassert>
|
|
|
|
#include <cstring>
|
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdarg>
|
2022-01-04 23:07:50 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
#include "ILexer.h"
|
|
|
|
#include "Scintilla.h"
|
|
|
|
#include "SciLexer.h"
|
|
|
|
|
|
|
|
#include "StringCopy.h"
|
|
|
|
#include "WordList.h"
|
|
|
|
#include "LexAccessor.h"
|
|
|
|
#include "StyleContext.h"
|
|
|
|
#include "CharacterSet.h"
|
|
|
|
#include "LexerModule.h"
|
|
|
|
#include "OptionSet.h"
|
|
|
|
#include "SubStyles.h"
|
|
|
|
#include "DefaultLexer.h"
|
|
|
|
|
|
|
|
using namespace Scintilla;
|
|
|
|
using namespace Lexilla;
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
namespace {
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
#define HERE_DELIM_MAX 256
|
|
|
|
|
|
|
|
// define this if you want 'invalid octals' to be marked as errors
|
|
|
|
// usually, this is not a good idea, permissive lexing is better
|
|
|
|
#undef PEDANTIC_OCTAL
|
|
|
|
|
|
|
|
#define BASH_BASE_ERROR 65
|
|
|
|
#define BASH_BASE_DECIMAL 66
|
|
|
|
#define BASH_BASE_HEX 67
|
|
|
|
#ifdef PEDANTIC_OCTAL
|
|
|
|
#define BASH_BASE_OCTAL 68
|
|
|
|
#define BASH_BASE_OCTAL_ERROR 69
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// state constants for parts of a bash command segment
|
2023-05-31 23:11:12 +00:00
|
|
|
enum class CmdState {
|
|
|
|
Body,
|
|
|
|
Start,
|
|
|
|
Word,
|
|
|
|
Test, // test
|
|
|
|
SingleBracket, // []
|
2023-09-22 09:32:35 +00:00
|
|
|
DoubleBracket, // [[]]
|
|
|
|
Arithmetic,
|
|
|
|
Delimiter,
|
2023-05-31 23:11:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class CommandSubstitution {
|
|
|
|
Backtick,
|
|
|
|
Inside,
|
|
|
|
InsideTrack,
|
|
|
|
};
|
2022-01-04 23:07:50 +00:00
|
|
|
|
|
|
|
// state constants for nested delimiter pairs, used by
|
2023-05-31 23:11:12 +00:00
|
|
|
// SCE_SH_STRING, SCE_SH_PARAM and SCE_SH_BACKTICKS processing
|
|
|
|
enum class QuoteStyle {
|
|
|
|
Literal, // ''
|
|
|
|
CString, // $''
|
|
|
|
String, // ""
|
|
|
|
LString, // $""
|
|
|
|
HereDoc, // here document
|
2023-09-22 09:32:35 +00:00
|
|
|
Backtick, // ``
|
2023-05-31 23:11:12 +00:00
|
|
|
Parameter, // ${}
|
|
|
|
Command, // $()
|
|
|
|
CommandInside, // $() with styling inside
|
|
|
|
Arithmetic, // $(()), $[]
|
|
|
|
};
|
2022-01-04 23:07:50 +00:00
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
#define BASH_QUOTE_STACK_MAX 7
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
#define BASH_SPECIAL_PARAMETER "*@#?-$!"
|
2022-01-04 23:07:50 +00:00
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
constexpr int commandSubstitutionFlag = 0x40;
|
|
|
|
constexpr int MaskCommand(int state) noexcept {
|
|
|
|
return state & ~commandSubstitutionFlag;
|
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
constexpr int translateBashDigit(int ch) noexcept {
|
2022-01-04 23:07:50 +00:00
|
|
|
if (ch >= '0' && ch <= '9') {
|
|
|
|
return ch - '0';
|
|
|
|
} else if (ch >= 'a' && ch <= 'z') {
|
|
|
|
return ch - 'a' + 10;
|
|
|
|
} else if (ch >= 'A' && ch <= 'Z') {
|
|
|
|
return ch - 'A' + 36;
|
|
|
|
} else if (ch == '@') {
|
|
|
|
return 62;
|
|
|
|
} else if (ch == '_') {
|
|
|
|
return 63;
|
|
|
|
}
|
|
|
|
return BASH_BASE_ERROR;
|
|
|
|
}
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
int getBashNumberBase(char *s) noexcept {
|
2022-01-04 23:07:50 +00:00
|
|
|
int i = 0;
|
|
|
|
int base = 0;
|
|
|
|
while (*s) {
|
|
|
|
base = base * 10 + (*s++ - '0');
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if (base > 64 || i > 2) {
|
|
|
|
return BASH_BASE_ERROR;
|
|
|
|
}
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
constexpr int opposite(int ch) noexcept {
|
2022-01-04 23:07:50 +00:00
|
|
|
if (ch == '(') return ')';
|
|
|
|
if (ch == '[') return ']';
|
|
|
|
if (ch == '{') return '}';
|
|
|
|
if (ch == '<') return '>';
|
|
|
|
return ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
int GlobScan(StyleContext &sc) {
|
|
|
|
// forward scan for zsh globs, disambiguate versus bash arrays
|
|
|
|
// complex expressions may still fail, e.g. unbalanced () '' "" etc
|
2023-05-31 23:11:12 +00:00
|
|
|
int c = 0;
|
|
|
|
int sLen = 0;
|
2022-01-04 23:07:50 +00:00
|
|
|
int pCount = 0;
|
|
|
|
int hash = 0;
|
|
|
|
while ((c = sc.GetRelativeCharacter(++sLen)) != 0) {
|
|
|
|
if (IsASpace(c)) {
|
|
|
|
return 0;
|
|
|
|
} else if (c == '\'' || c == '\"') {
|
|
|
|
if (hash != 2) return 0;
|
|
|
|
} else if (c == '#' && hash == 0) {
|
|
|
|
hash = (sLen == 1) ? 2:1;
|
|
|
|
} else if (c == '(') {
|
|
|
|
pCount++;
|
|
|
|
} else if (c == ')') {
|
|
|
|
if (pCount == 0) {
|
|
|
|
if (hash) return sLen;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pCount--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsCommentLine(Sci_Position line, LexAccessor &styler) {
|
2023-05-31 23:11:12 +00:00
|
|
|
const Sci_Position pos = styler.LineStart(line);
|
|
|
|
const Sci_Position eol_pos = styler.LineStart(line + 1) - 1;
|
2022-01-04 23:07:50 +00:00
|
|
|
for (Sci_Position i = pos; i < eol_pos; i++) {
|
2023-05-31 23:11:12 +00:00
|
|
|
const char ch = styler[i];
|
2022-01-04 23:07:50 +00:00
|
|
|
if (ch == '#')
|
|
|
|
return true;
|
|
|
|
else if (ch != ' ' && ch != '\t')
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-09-22 09:32:35 +00:00
|
|
|
constexpr bool StyleForceBacktrack(int state) noexcept {
|
|
|
|
return AnyOf(state, SCE_SH_CHARACTER, SCE_SH_STRING, SCE_SH_BACKTICKS, SCE_SH_HERE_Q, SCE_SH_PARAM);
|
|
|
|
}
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
struct OptionsBash {
|
2023-05-31 23:11:12 +00:00
|
|
|
bool fold = false;
|
|
|
|
bool foldComment = false;
|
|
|
|
bool foldCompact = true;
|
|
|
|
bool stylingInsideString = false;
|
|
|
|
bool stylingInsideBackticks = false;
|
|
|
|
bool stylingInsideParameter = false;
|
|
|
|
bool stylingInsideHeredoc = false;
|
2023-09-22 09:32:35 +00:00
|
|
|
bool nestedBackticks = true;
|
2023-05-31 23:11:12 +00:00
|
|
|
int commandSubstitution = static_cast<int>(CommandSubstitution::Backtick);
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
std::string specialParameter = BASH_SPECIAL_PARAMETER;
|
2022-01-04 23:07:50 +00:00
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
[[nodiscard]] bool stylingInside(int state) const noexcept {
|
|
|
|
switch (state) {
|
|
|
|
case SCE_SH_STRING:
|
|
|
|
return stylingInsideString;
|
|
|
|
case SCE_SH_BACKTICKS:
|
|
|
|
return stylingInsideBackticks;
|
|
|
|
case SCE_SH_PARAM:
|
|
|
|
return stylingInsideParameter;
|
|
|
|
case SCE_SH_HERE_Q:
|
|
|
|
return stylingInsideHeredoc;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const char * const bashWordListDesc[] = {
|
|
|
|
"Keywords",
|
2023-05-31 23:11:12 +00:00
|
|
|
nullptr
|
2022-01-04 23:07:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct OptionSetBash : public OptionSet<OptionsBash> {
|
|
|
|
OptionSetBash() {
|
|
|
|
DefineProperty("fold", &OptionsBash::fold);
|
|
|
|
|
|
|
|
DefineProperty("fold.comment", &OptionsBash::foldComment);
|
|
|
|
|
|
|
|
DefineProperty("fold.compact", &OptionsBash::foldCompact);
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
DefineProperty("lexer.bash.styling.inside.string", &OptionsBash::stylingInsideString,
|
|
|
|
"Set this property to 1 to highlight shell expansions inside string.");
|
|
|
|
|
|
|
|
DefineProperty("lexer.bash.styling.inside.backticks", &OptionsBash::stylingInsideBackticks,
|
|
|
|
"Set this property to 1 to highlight shell expansions inside backticks.");
|
|
|
|
|
|
|
|
DefineProperty("lexer.bash.styling.inside.parameter", &OptionsBash::stylingInsideParameter,
|
|
|
|
"Set this property to 1 to highlight shell expansions inside ${} parameter expansion.");
|
|
|
|
|
|
|
|
DefineProperty("lexer.bash.styling.inside.heredoc", &OptionsBash::stylingInsideHeredoc,
|
|
|
|
"Set this property to 1 to highlight shell expansions inside here document.");
|
|
|
|
|
|
|
|
DefineProperty("lexer.bash.command.substitution", &OptionsBash::commandSubstitution,
|
|
|
|
"Set how to highlight $() command substitution. "
|
|
|
|
"0 (the default) highlighted as backticks. "
|
|
|
|
"1 highlighted inside. "
|
|
|
|
"2 highlighted inside with extra scope tracking.");
|
|
|
|
|
2023-09-22 09:32:35 +00:00
|
|
|
DefineProperty("lexer.bash.nested.backticks", &OptionsBash::nestedBackticks,
|
|
|
|
"Set this property to 0 to disable nested backquoted command substitution.");
|
|
|
|
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
DefineProperty("lexer.bash.special.parameter", &OptionsBash::specialParameter,
|
|
|
|
"Set shell (default is Bash) special parameters.");
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
DefineWordListSets(bashWordListDesc);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
class QuoteCls { // Class to manage quote pairs (simplified vs LexPerl)
|
|
|
|
public:
|
|
|
|
int Count = 0;
|
|
|
|
int Up = '\0';
|
|
|
|
int Down = '\0';
|
|
|
|
QuoteStyle Style = QuoteStyle::Literal;
|
|
|
|
int Outer = SCE_SH_DEFAULT;
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
CmdState State = CmdState::Body;
|
2023-05-31 23:11:12 +00:00
|
|
|
void Clear() noexcept {
|
|
|
|
Count = 0;
|
|
|
|
Up = '\0';
|
|
|
|
Down = '\0';
|
|
|
|
Style = QuoteStyle::Literal;
|
|
|
|
Outer = SCE_SH_DEFAULT;
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
State = CmdState::Body;
|
2023-05-31 23:11:12 +00:00
|
|
|
}
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
void Start(int u, QuoteStyle s, int outer, CmdState state) noexcept {
|
2023-05-31 23:11:12 +00:00
|
|
|
Count = 1;
|
|
|
|
Up = u;
|
|
|
|
Down = opposite(Up);
|
|
|
|
Style = s;
|
|
|
|
Outer = outer;
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
State = state;
|
2023-05-31 23:11:12 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class QuoteStackCls { // Class to manage quote pairs that nest
|
|
|
|
public:
|
|
|
|
int Depth = 0;
|
|
|
|
int State = SCE_SH_DEFAULT;
|
2023-09-22 09:32:35 +00:00
|
|
|
bool lineContinuation = false;
|
|
|
|
bool nestedBackticks = false;
|
2023-05-31 23:11:12 +00:00
|
|
|
CommandSubstitution commandSubstitution = CommandSubstitution::Backtick;
|
|
|
|
int insideCommand = 0;
|
2023-09-22 09:32:35 +00:00
|
|
|
unsigned backtickLevel = 0;
|
2023-05-31 23:11:12 +00:00
|
|
|
QuoteCls Current;
|
|
|
|
QuoteCls Stack[BASH_QUOTE_STACK_MAX];
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
const CharacterSet &setParamStart;
|
|
|
|
QuoteStackCls(const CharacterSet &setParamStart_) noexcept : setParamStart{setParamStart_} {}
|
2023-05-31 23:11:12 +00:00
|
|
|
[[nodiscard]] bool Empty() const noexcept {
|
|
|
|
return Current.Up == '\0';
|
|
|
|
}
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
void Start(int u, QuoteStyle s, int outer, CmdState state) noexcept {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (Empty()) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
Current.Start(u, s, outer, state);
|
2023-09-22 09:32:35 +00:00
|
|
|
if (s == QuoteStyle::Backtick) {
|
|
|
|
++backtickLevel;
|
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
} else {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
Push(u, s, outer, state);
|
2023-05-31 23:11:12 +00:00
|
|
|
}
|
|
|
|
}
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
void Push(int u, QuoteStyle s, int outer, CmdState state) noexcept {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (Depth >= BASH_QUOTE_STACK_MAX) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Stack[Depth] = Current;
|
|
|
|
Depth++;
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
Current.Start(u, s, outer, state);
|
2023-09-22 09:32:35 +00:00
|
|
|
if (s == QuoteStyle::Backtick) {
|
|
|
|
++backtickLevel;
|
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
}
|
|
|
|
void Pop() noexcept {
|
|
|
|
if (Depth == 0) {
|
|
|
|
Clear();
|
|
|
|
return;
|
|
|
|
}
|
2023-09-22 09:32:35 +00:00
|
|
|
if (backtickLevel != 0 && Current.Style == QuoteStyle::Backtick) {
|
|
|
|
--backtickLevel;
|
|
|
|
}
|
|
|
|
if (insideCommand != 0 && Current.Style == QuoteStyle::CommandInside) {
|
2023-05-31 23:11:12 +00:00
|
|
|
insideCommand = 0;
|
|
|
|
for (int i = 0; i < Depth; i++) {
|
|
|
|
if (Stack[i].Style == QuoteStyle::CommandInside) {
|
|
|
|
insideCommand = commandSubstitutionFlag;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Depth--;
|
|
|
|
Current = Stack[Depth];
|
|
|
|
}
|
|
|
|
void Clear() noexcept {
|
|
|
|
Depth = 0;
|
|
|
|
State = SCE_SH_DEFAULT;
|
|
|
|
insideCommand = 0;
|
2023-09-22 09:32:35 +00:00
|
|
|
backtickLevel = 0;
|
2023-05-31 23:11:12 +00:00
|
|
|
Current.Clear();
|
|
|
|
}
|
|
|
|
bool CountDown(StyleContext &sc, CmdState &cmdState) {
|
|
|
|
Current.Count--;
|
Updated to Scintilla 5.4.1 & Lexilla 5.3.0
Scintilla 5.4.1
https://www.scintilla.org/scintilla541.zip
Released 27 December 2023.
1. Add IDocumentEditable interface to allow efficient interaction with document objects which may not be visible in a Scintilla instance. This feature is provisonal and may change before being declared stable. For better type-safety, the ScintillaCall C++ API uses IDocumentEditable* where void* was used before which may require changes to client code that uses document pointer APIs DocPointer, SetDocPointer, CreateDocument, AddRefDocument, and ReleaseDocument.
2. Ctrl-click on a selection deselects it in multiple selection mode.
3. Add SCI_SELECTIONFROMPOINT for modifying multiple selections.
4. Add SCI_SETMOVEEXTENDSSELECTION and SCI_CHANGESELECTIONMODE to simplify selection mode manipulation.
5. Improve performance of global replace by reducing cache invalidation overhead. [Feature #1502](https://sourceforge.net/p/scintilla/feature-requests/1502/).
6. Fix regular expression search for "\<" matching beginning of search when not beginning of word and for "\>" not matching line end. [Bug #2157](https://sourceforge.net/p/scintilla/bugs/2157/).
7. Fix regular expression search failure when search for "\<" followed by search for "\>". [Bug #2413](https://sourceforge.net/p/scintilla/bugs/2413/).
8. Fix regular expression assertion (^, $, \b. \B) failures when using SCFIND_CXX11REGEX. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
9. Fix regular expression bug in reverse direction where shortened match returned. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
10. Avoid character fragments in regular expression search results. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
11. With a document that does not have the SC_DOCUMENTOPTION_TEXT_LARGE option set, allocating more than 2G (calling SCI_ALLOCATE or similar) will now fail with SC_STATUS_FAILURE.
12. Protect SCI_REPLACETARGET, SCI_REPLACETARGETMINIMAL, and SCI_REPLACETARGETRE from application changing target in notification handlers. [Bug #2289](https://sourceforge.net/p/scintilla/bugs/2289/).
Lexilla 5.3.0
https://www.scintilla.org/lexilla530.zip
Released 27 December 2023.
1. Fix calling AddStaticLexerModule by defining as C++ instead of C which matches header. [Bug #2421](https://sourceforge.net/p/scintilla/bugs/2421/).
2. Bash: Fix shift operator << incorrectly recognized as here-doc. [Issue #215](https://github.com/ScintillaOrg/lexilla/issues/215).
3. Bash: Fix termination of '${' with first unquoted '}' instead of nesting. [Issue #216](https://github.com/ScintillaOrg/lexilla/issues/216).
4. HTML: JavaScript double-quoted strings may escape line end with '\'. [Issue #214](https://github.com/ScintillaOrg/lexilla/issues/214).
5. Lua: recognize --- doc comments. Defined by [LDoc](https://github.com/lunarmodules/ldoc). Does not recognize --[[-- doc comments which seem less common.
Close #14375
2023-11-19 17:46:55 +00:00
|
|
|
while (Current.Count > 0 && sc.chNext == Current.Down) {
|
2023-05-31 23:11:12 +00:00
|
|
|
Current.Count--;
|
|
|
|
sc.Forward();
|
|
|
|
}
|
|
|
|
if (Current.Count == 0) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
cmdState = Current.State;
|
2023-05-31 23:11:12 +00:00
|
|
|
const int outer = Current.Outer;
|
|
|
|
Pop();
|
|
|
|
sc.ForwardSetState(outer | insideCommand);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
void Expand(StyleContext &sc, CmdState &cmdState, bool stylingInside) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
const CmdState current = cmdState;
|
2023-05-31 23:11:12 +00:00
|
|
|
const int state = sc.state;
|
|
|
|
QuoteStyle style = QuoteStyle::Literal;
|
|
|
|
State = state;
|
|
|
|
sc.SetState(SCE_SH_SCALAR);
|
|
|
|
sc.Forward();
|
|
|
|
if (sc.ch == '{') {
|
|
|
|
style = QuoteStyle::Parameter;
|
|
|
|
sc.ChangeState(SCE_SH_PARAM);
|
|
|
|
} else if (sc.ch == '\'') {
|
|
|
|
style = QuoteStyle::CString;
|
|
|
|
sc.ChangeState(SCE_SH_STRING);
|
|
|
|
} else if (sc.ch == '"') {
|
|
|
|
style = QuoteStyle::LString;
|
|
|
|
sc.ChangeState(SCE_SH_STRING);
|
|
|
|
} else if (sc.ch == '(' || sc.ch == '[') {
|
|
|
|
if (sc.ch == '[' || sc.chNext == '(') {
|
|
|
|
style = QuoteStyle::Arithmetic;
|
|
|
|
cmdState = CmdState::Arithmetic;
|
|
|
|
sc.ChangeState(SCE_SH_OPERATOR);
|
|
|
|
} else {
|
|
|
|
if (stylingInside && commandSubstitution >= CommandSubstitution::Inside) {
|
|
|
|
style = QuoteStyle::CommandInside;
|
|
|
|
cmdState = CmdState::Delimiter;
|
|
|
|
sc.ChangeState(SCE_SH_OPERATOR);
|
|
|
|
if (commandSubstitution == CommandSubstitution::InsideTrack) {
|
|
|
|
insideCommand = commandSubstitutionFlag;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
style = QuoteStyle::Command;
|
|
|
|
sc.ChangeState(SCE_SH_BACKTICKS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// scalar has no delimiter pair
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
if (!setParamStart.Contains(sc.ch)) {
|
|
|
|
stylingInside = false; // not scalar
|
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
}
|
|
|
|
if (!stylingInside) {
|
|
|
|
sc.ChangeState(state);
|
|
|
|
} else {
|
|
|
|
sc.ChangeState(sc.state | insideCommand);
|
|
|
|
}
|
|
|
|
if (style != QuoteStyle::Literal) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
Start(sc.ch, style, state, current);
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.Forward();
|
|
|
|
}
|
|
|
|
}
|
2023-09-22 09:32:35 +00:00
|
|
|
void Escape(StyleContext &sc) {
|
|
|
|
unsigned count = 1;
|
|
|
|
while (sc.chNext == '\\') {
|
|
|
|
++count;
|
|
|
|
sc.Forward();
|
|
|
|
}
|
|
|
|
bool escaped = count & 1U; // odd backslash escape next character
|
|
|
|
if (escaped && (sc.chNext == '\r' || sc.chNext == '\n')) {
|
|
|
|
lineContinuation = true;
|
|
|
|
if (sc.state == SCE_SH_IDENTIFIER) {
|
|
|
|
sc.SetState(SCE_SH_OPERATOR | insideCommand);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (backtickLevel > 0 && nestedBackticks) {
|
|
|
|
/*
|
|
|
|
for $k$ level substitution with $N$ backslashes:
|
|
|
|
* when $N/2^k$ is odd, following dollar is escaped.
|
|
|
|
* when $(N - 1)/2^k$ is even, following quote is escaped.
|
|
|
|
* when $N = n\times 2^{k + 1} - 1$, following backtick is escaped.
|
|
|
|
* when $N = n\times 2^{k + 1} + 2^k - 1$, following backtick starts inner substitution.
|
|
|
|
* when $N = m\times 2^k + 2^{k - 1} - 1$ and $k > 1$, following backtick ends current substitution.
|
|
|
|
*/
|
|
|
|
if (sc.chNext == '$') {
|
|
|
|
escaped = (count >> backtickLevel) & 1U;
|
|
|
|
} else if (sc.chNext == '\"' || sc.chNext == '\'') {
|
|
|
|
escaped = (((count - 1) >> backtickLevel) & 1U) == 0;
|
|
|
|
} else if (sc.chNext == '`' && escaped) {
|
|
|
|
unsigned mask = 1U << (backtickLevel + 1);
|
|
|
|
count += 1;
|
|
|
|
escaped = (count & (mask - 1)) == 0;
|
|
|
|
if (!escaped) {
|
|
|
|
unsigned remain = count - (mask >> 1U);
|
|
|
|
if (static_cast<int>(remain) >= 0 && (remain & (mask - 1)) == 0) {
|
|
|
|
escaped = true;
|
|
|
|
++backtickLevel;
|
|
|
|
} else if (backtickLevel > 1) {
|
|
|
|
mask >>= 1U;
|
|
|
|
remain = count - (mask >> 1U);
|
|
|
|
if (static_cast<int>(remain) >= 0 && (remain & (mask - 1)) == 0) {
|
|
|
|
escaped = true;
|
|
|
|
--backtickLevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (escaped) {
|
|
|
|
sc.Forward();
|
|
|
|
}
|
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
};
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
const char styleSubable[] = { SCE_SH_IDENTIFIER, SCE_SH_SCALAR, 0 };
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
const LexicalClass lexicalClasses[] = {
|
2022-01-04 23:07:50 +00:00
|
|
|
// Lexer Bash SCLEX_BASH SCE_SH_:
|
|
|
|
0, "SCE_SH_DEFAULT", "default", "White space",
|
|
|
|
1, "SCE_SH_ERROR", "error", "Error",
|
|
|
|
2, "SCE_SH_COMMENTLINE", "comment line", "Line comment: #",
|
|
|
|
3, "SCE_SH_NUMBER", "literal numeric", "Number",
|
|
|
|
4, "SCE_SH_WORD", "keyword", "Keyword",
|
|
|
|
5, "SCE_SH_STRING", "literal string", "String",
|
|
|
|
6, "SCE_SH_CHARACTER", "literal string", "Single quoted string",
|
|
|
|
7, "SCE_SH_OPERATOR", "operator", "Operators",
|
|
|
|
8, "SCE_SH_IDENTIFIER", "identifier", "Identifiers",
|
|
|
|
9, "SCE_SH_SCALAR", "identifier", "Scalar variable",
|
|
|
|
10, "SCE_SH_PARAM", "identifier", "Parameter",
|
|
|
|
11, "SCE_SH_BACKTICKS", "literal string", "Backtick quoted command",
|
|
|
|
12, "SCE_SH_HERE_DELIM", "operator", "Heredoc delimiter",
|
2023-11-05 17:24:41 +00:00
|
|
|
13, "SCE_SH_HERE_Q", "here-doc literal string", "Heredoc quoted string",
|
2022-01-04 23:07:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
class LexerBash final : public DefaultLexer {
|
2022-01-04 23:07:50 +00:00
|
|
|
WordList keywords;
|
2023-05-31 23:11:12 +00:00
|
|
|
WordList cmdDelimiter;
|
|
|
|
WordList bashStruct;
|
|
|
|
WordList bashStruct_in;
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
WordList testOperator;
|
2022-01-04 23:07:50 +00:00
|
|
|
OptionsBash options;
|
|
|
|
OptionSetBash osBash;
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
CharacterSet setParamStart;
|
2022-01-04 23:07:50 +00:00
|
|
|
enum { ssIdentifier, ssScalar };
|
|
|
|
SubStyles subStyles;
|
|
|
|
public:
|
|
|
|
LexerBash() :
|
2023-11-05 17:24:41 +00:00
|
|
|
DefaultLexer("bash", SCLEX_BASH, lexicalClasses, std::size(lexicalClasses)),
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
setParamStart(CharacterSet::setAlphaNum, "_" BASH_SPECIAL_PARAMETER),
|
2022-01-04 23:07:50 +00:00
|
|
|
subStyles(styleSubable, 0x80, 0x40, 0) {
|
2023-05-31 23:11:12 +00:00
|
|
|
cmdDelimiter.Set("| || |& & && ; ;; ( ) { }");
|
|
|
|
bashStruct.Set("if elif fi while until else then do done esac eval");
|
|
|
|
bashStruct_in.Set("for case select");
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
testOperator.Set("eq ge gt le lt ne ef nt ot");
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
void SCI_METHOD Release() override {
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
int SCI_METHOD Version() const override {
|
|
|
|
return lvRelease5;
|
|
|
|
}
|
|
|
|
const char * SCI_METHOD PropertyNames() override {
|
|
|
|
return osBash.PropertyNames();
|
|
|
|
}
|
|
|
|
int SCI_METHOD PropertyType(const char* name) override {
|
|
|
|
return osBash.PropertyType(name);
|
|
|
|
}
|
|
|
|
const char * SCI_METHOD DescribeProperty(const char *name) override {
|
|
|
|
return osBash.DescribeProperty(name);
|
|
|
|
}
|
|
|
|
Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
|
|
|
|
const char * SCI_METHOD PropertyGet(const char* key) override {
|
|
|
|
return osBash.PropertyGet(key);
|
|
|
|
}
|
|
|
|
const char * SCI_METHOD DescribeWordListSets() override {
|
|
|
|
return osBash.DescribeWordListSets();
|
|
|
|
}
|
|
|
|
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
|
|
|
|
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
void SCI_METHOD Fold(Sci_PositionU startPos_, Sci_Position length, int initStyle, IDocument *pAccess) override;
|
2022-01-04 23:07:50 +00:00
|
|
|
|
|
|
|
void * SCI_METHOD PrivateCall(int, void *) override {
|
2023-05-31 23:11:12 +00:00
|
|
|
return nullptr;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) override {
|
|
|
|
return subStyles.Allocate(styleBase, numberStyles);
|
|
|
|
}
|
|
|
|
int SCI_METHOD SubStylesStart(int styleBase) override {
|
|
|
|
return subStyles.Start(styleBase);
|
|
|
|
}
|
|
|
|
int SCI_METHOD SubStylesLength(int styleBase) override {
|
|
|
|
return subStyles.Length(styleBase);
|
|
|
|
}
|
|
|
|
int SCI_METHOD StyleFromSubStyle(int subStyle) override {
|
|
|
|
const int styleBase = subStyles.BaseStyle(subStyle);
|
|
|
|
return styleBase;
|
|
|
|
}
|
|
|
|
int SCI_METHOD PrimaryStyleFromStyle(int style) override {
|
|
|
|
return style;
|
|
|
|
}
|
|
|
|
void SCI_METHOD FreeSubStyles() override {
|
|
|
|
subStyles.Free();
|
|
|
|
}
|
|
|
|
void SCI_METHOD SetIdentifiers(int style, const char *identifiers) override {
|
|
|
|
subStyles.SetIdentifiers(style, identifiers);
|
|
|
|
}
|
|
|
|
int SCI_METHOD DistanceToSecondaryStyles() override {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
const char *SCI_METHOD GetSubStyleBases() override {
|
|
|
|
return styleSubable;
|
|
|
|
}
|
|
|
|
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
bool IsTestOperator(const char *s, const CharacterSet &setSingleCharOp) const noexcept {
|
|
|
|
return (s[2] == '\0' && setSingleCharOp.Contains(s[1]))
|
|
|
|
|| testOperator.InList(s + 1);
|
|
|
|
}
|
|
|
|
|
2022-01-04 23:07:50 +00:00
|
|
|
static ILexer5 *LexerFactoryBash() {
|
|
|
|
return new LexerBash();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Sci_Position SCI_METHOD LexerBash::PropertySet(const char *key, const char *val) {
|
|
|
|
if (osBash.PropertySet(&options, key, val)) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
if (strcmp(key, "lexer.bash.special.parameter") == 0) {
|
|
|
|
setParamStart = CharacterSet(CharacterSet::setAlphaNum, "_");
|
|
|
|
setParamStart.AddString(options.specialParameter.empty() ? BASH_SPECIAL_PARAMETER : options.specialParameter.c_str());
|
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Sci_Position SCI_METHOD LexerBash::WordListSet(int n, const char *wl) {
|
2023-05-31 23:11:12 +00:00
|
|
|
WordList *wordListN = nullptr;
|
2022-01-04 23:07:50 +00:00
|
|
|
switch (n) {
|
|
|
|
case 0:
|
|
|
|
wordListN = &keywords;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
Sci_Position firstModification = -1;
|
|
|
|
if (wordListN) {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (wordListN->Set(wl)) {
|
2022-01-04 23:07:50 +00:00
|
|
|
firstModification = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return firstModification;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SCI_METHOD LexerBash::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
|
2023-05-31 23:11:12 +00:00
|
|
|
const CharacterSet setWordStart(CharacterSet::setAlpha, "_");
|
2022-01-04 23:07:50 +00:00
|
|
|
// note that [+-] are often parts of identifiers in shell scripts
|
2023-05-31 23:11:12 +00:00
|
|
|
const CharacterSet setWord(CharacterSet::setAlphaNum, "._+-");
|
2022-01-04 23:07:50 +00:00
|
|
|
CharacterSet setMetaCharacter(CharacterSet::setNone, "|&;()<> \t\r\n");
|
|
|
|
setMetaCharacter.Add(0);
|
2023-05-31 23:11:12 +00:00
|
|
|
const CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/<?!.~@");
|
|
|
|
const CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMACahGLNn");
|
|
|
|
const CharacterSet setParam(CharacterSet::setAlphaNum, "_");
|
|
|
|
const CharacterSet setHereDoc(CharacterSet::setAlpha, "_\\-+!%*,./:?@[]^`{}~");
|
|
|
|
const CharacterSet setHereDoc2(CharacterSet::setAlphaNum, "_-+!%*,./:=?@[]^`{}~");
|
|
|
|
const CharacterSet setLeftShift(CharacterSet::setDigits, "$");
|
2022-01-04 23:07:50 +00:00
|
|
|
|
|
|
|
class HereDocCls { // Class to manage HERE document elements
|
|
|
|
public:
|
2023-05-31 23:11:12 +00:00
|
|
|
int State = 0; // 0: '<<' encountered
|
2022-01-04 23:07:50 +00:00
|
|
|
// 1: collect the delimiter
|
|
|
|
// 2: here doc text (lines after the delimiter)
|
2023-05-31 23:11:12 +00:00
|
|
|
int Quote = '\0'; // the char after '<<'
|
|
|
|
bool Quoted = false; // true if Quote in ('\'','"','`')
|
|
|
|
bool Escaped = false; // backslash in delimiter, common in configure script
|
|
|
|
bool Indent = false; // indented delimiter (for <<-)
|
|
|
|
int DelimiterLength = 0; // strlen(Delimiter)
|
|
|
|
char Delimiter[HERE_DELIM_MAX]{}; // the Delimiter
|
|
|
|
HereDocCls() noexcept = default;
|
2022-01-04 23:07:50 +00:00
|
|
|
void Append(int ch) {
|
|
|
|
Delimiter[DelimiterLength++] = static_cast<char>(ch);
|
|
|
|
Delimiter[DelimiterLength] = '\0';
|
|
|
|
}
|
|
|
|
};
|
|
|
|
HereDocCls HereDoc;
|
|
|
|
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStackCls QuoteStack(setParamStart);
|
2023-09-22 09:32:35 +00:00
|
|
|
QuoteStack.nestedBackticks = options.nestedBackticks;
|
2023-05-31 23:11:12 +00:00
|
|
|
QuoteStack.commandSubstitution = static_cast<CommandSubstitution>(options.commandSubstitution);
|
2022-01-04 23:07:50 +00:00
|
|
|
|
|
|
|
const WordClassifier &classifierIdentifiers = subStyles.Classifier(SCE_SH_IDENTIFIER);
|
|
|
|
const WordClassifier &classifierScalars = subStyles.Classifier(SCE_SH_SCALAR);
|
|
|
|
|
|
|
|
int numBase = 0;
|
2023-05-31 23:11:12 +00:00
|
|
|
int digit = 0;
|
|
|
|
const Sci_PositionU endPos = startPos + length;
|
|
|
|
CmdState cmdState = CmdState::Start;
|
2022-01-04 23:07:50 +00:00
|
|
|
LexAccessor styler(pAccess);
|
|
|
|
|
|
|
|
// Always backtracks to the start of a line that is not a continuation
|
|
|
|
// of the previous line (i.e. start of a bash command segment)
|
|
|
|
Sci_Position ln = styler.GetLine(startPos);
|
|
|
|
if (ln > 0 && startPos == static_cast<Sci_PositionU>(styler.LineStart(ln)))
|
|
|
|
ln--;
|
|
|
|
for (;;) {
|
|
|
|
startPos = styler.LineStart(ln);
|
2023-05-31 23:11:12 +00:00
|
|
|
if (ln == 0 || styler.GetLineState(ln) == static_cast<int>(CmdState::Start))
|
2022-01-04 23:07:50 +00:00
|
|
|
break;
|
|
|
|
ln--;
|
|
|
|
}
|
|
|
|
initStyle = SCE_SH_DEFAULT;
|
|
|
|
|
|
|
|
StyleContext sc(startPos, endPos - startPos, initStyle, styler);
|
|
|
|
|
2023-05-31 23:11:12 +00:00
|
|
|
while (sc.More()) {
|
2022-01-04 23:07:50 +00:00
|
|
|
|
|
|
|
// handle line continuation, updates per-line stored state
|
|
|
|
if (sc.atLineStart) {
|
2023-09-22 09:32:35 +00:00
|
|
|
CmdState state = CmdState::Body; // force backtrack while retaining cmdState
|
|
|
|
if (!StyleForceBacktrack(MaskCommand(sc.state))) {
|
|
|
|
// retain last line's state
|
|
|
|
// arithmetic expression and double bracket test can span multiline without line continuation
|
|
|
|
if (!QuoteStack.lineContinuation && !AnyOf(cmdState, CmdState::DoubleBracket, CmdState::Arithmetic)) {
|
|
|
|
cmdState = CmdState::Start;
|
|
|
|
}
|
|
|
|
if (QuoteStack.Empty()) { // force backtrack when nesting
|
|
|
|
state = cmdState;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
2023-09-22 09:32:35 +00:00
|
|
|
QuoteStack.lineContinuation = false;
|
|
|
|
styler.SetLineState(sc.currentLine, static_cast<int>(state));
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// controls change of cmdState at the end of a non-whitespace element
|
2023-05-31 23:11:12 +00:00
|
|
|
// states Body|Test|Arithmetic persist until the end of a command segment
|
|
|
|
// state Word persist, but ends with 'in' or 'do' construct keywords
|
|
|
|
CmdState cmdStateNew = CmdState::Body;
|
2023-09-22 09:32:35 +00:00
|
|
|
if (cmdState >= CmdState::Word && cmdState <= CmdState::Arithmetic)
|
2022-01-04 23:07:50 +00:00
|
|
|
cmdStateNew = cmdState;
|
2023-05-31 23:11:12 +00:00
|
|
|
const int stylePrev = MaskCommand(sc.state);
|
|
|
|
const int insideCommand = QuoteStack.insideCommand;
|
2022-01-04 23:07:50 +00:00
|
|
|
|
|
|
|
// Determine if the current state should terminate.
|
2023-05-31 23:11:12 +00:00
|
|
|
switch (MaskCommand(sc.state)) {
|
2022-01-04 23:07:50 +00:00
|
|
|
case SCE_SH_OPERATOR:
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
|
|
|
if (cmdState == CmdState::Delimiter) // if command delimiter, start new command
|
|
|
|
cmdStateNew = CmdState::Start;
|
2022-01-04 23:07:50 +00:00
|
|
|
else if (sc.chPrev == '\\') // propagate command state if line continued
|
|
|
|
cmdStateNew = cmdState;
|
|
|
|
break;
|
|
|
|
case SCE_SH_WORD:
|
|
|
|
// "." never used in Bash variable names but used in file names
|
2023-09-22 09:32:35 +00:00
|
|
|
if (!setWord.Contains(sc.ch) || sc.Match('+', '=') || sc.Match('.', '.')) {
|
2022-01-04 23:07:50 +00:00
|
|
|
char s[500];
|
|
|
|
sc.GetCurrent(s, sizeof(s));
|
2023-05-31 23:11:12 +00:00
|
|
|
int identifierStyle = SCE_SH_IDENTIFIER | insideCommand;
|
|
|
|
const int subStyle = classifierIdentifiers.ValueFor(s);
|
2022-01-04 23:07:50 +00:00
|
|
|
if (subStyle >= 0) {
|
2023-05-31 23:11:12 +00:00
|
|
|
identifierStyle = subStyle | insideCommand;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
// allow keywords ending in a whitespace, meta character or command delimiter
|
2023-05-31 23:11:12 +00:00
|
|
|
char s2[10];
|
2022-01-04 23:07:50 +00:00
|
|
|
s2[0] = static_cast<char>(sc.ch);
|
|
|
|
s2[1] = '\0';
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
const bool keywordEnds = IsASpace(sc.ch) || setMetaCharacter.Contains(sc.ch) || cmdDelimiter.InList(s2);
|
2022-01-04 23:07:50 +00:00
|
|
|
// 'in' or 'do' may be construct keywords
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Word) {
|
2022-01-04 23:07:50 +00:00
|
|
|
if (strcmp(s, "in") == 0 && keywordEnds)
|
2023-05-31 23:11:12 +00:00
|
|
|
cmdStateNew = CmdState::Body;
|
2022-01-04 23:07:50 +00:00
|
|
|
else if (strcmp(s, "do") == 0 && keywordEnds)
|
2023-05-31 23:11:12 +00:00
|
|
|
cmdStateNew = CmdState::Start;
|
2022-01-04 23:07:50 +00:00
|
|
|
else
|
|
|
|
sc.ChangeState(identifierStyle);
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
// a 'test' keyword starts a test expression
|
|
|
|
if (strcmp(s, "test") == 0) {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Start && keywordEnds) {
|
|
|
|
cmdStateNew = CmdState::Test;
|
2022-01-04 23:07:50 +00:00
|
|
|
} else
|
|
|
|
sc.ChangeState(identifierStyle);
|
|
|
|
}
|
|
|
|
// detect bash construct keywords
|
|
|
|
else if (bashStruct.InList(s)) {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Start && keywordEnds)
|
|
|
|
cmdStateNew = CmdState::Start;
|
2022-01-04 23:07:50 +00:00
|
|
|
else
|
|
|
|
sc.ChangeState(identifierStyle);
|
|
|
|
}
|
|
|
|
// 'for'|'case'|'select' needs 'in'|'do' to be highlighted later
|
|
|
|
else if (bashStruct_in.InList(s)) {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Start && keywordEnds)
|
|
|
|
cmdStateNew = CmdState::Word;
|
2022-01-04 23:07:50 +00:00
|
|
|
else
|
|
|
|
sc.ChangeState(identifierStyle);
|
|
|
|
}
|
|
|
|
// disambiguate option items and file test operators
|
|
|
|
else if (s[0] == '-') {
|
2023-09-22 09:32:35 +00:00
|
|
|
if (!AnyOf(cmdState, CmdState::Test, CmdState::SingleBracket, CmdState::DoubleBracket)
|
|
|
|
|| !keywordEnds || !IsTestOperator(s, setSingleCharOp))
|
2022-01-04 23:07:50 +00:00
|
|
|
sc.ChangeState(identifierStyle);
|
|
|
|
}
|
|
|
|
// disambiguate keywords and identifiers
|
2023-05-31 23:11:12 +00:00
|
|
|
else if (cmdState != CmdState::Start
|
2022-01-04 23:07:50 +00:00
|
|
|
|| !(keywords.InList(s) && keywordEnds)) {
|
|
|
|
sc.ChangeState(identifierStyle);
|
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SCE_SH_IDENTIFIER:
|
2023-09-22 09:32:35 +00:00
|
|
|
if (!setWord.Contains(sc.ch) ||
|
2023-05-31 23:11:12 +00:00
|
|
|
(cmdState == CmdState::Arithmetic && !setWordStart.Contains(sc.ch))) {
|
2022-01-04 23:07:50 +00:00
|
|
|
char s[500];
|
|
|
|
sc.GetCurrent(s, sizeof(s));
|
2023-05-31 23:11:12 +00:00
|
|
|
const int subStyle = classifierIdentifiers.ValueFor(s);
|
2022-01-04 23:07:50 +00:00
|
|
|
if (subStyle >= 0) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.ChangeState(subStyle | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SCE_SH_NUMBER:
|
|
|
|
digit = translateBashDigit(sc.ch);
|
|
|
|
if (numBase == BASH_BASE_DECIMAL) {
|
|
|
|
if (sc.ch == '#') {
|
|
|
|
char s[10];
|
|
|
|
sc.GetCurrent(s, sizeof(s));
|
|
|
|
numBase = getBashNumberBase(s);
|
|
|
|
if (numBase != BASH_BASE_ERROR)
|
|
|
|
break;
|
|
|
|
} else if (IsADigit(sc.ch))
|
|
|
|
break;
|
|
|
|
} else if (numBase == BASH_BASE_HEX) {
|
|
|
|
if (IsADigit(sc.ch, 16))
|
|
|
|
break;
|
|
|
|
#ifdef PEDANTIC_OCTAL
|
|
|
|
} else if (numBase == BASH_BASE_OCTAL ||
|
|
|
|
numBase == BASH_BASE_OCTAL_ERROR) {
|
|
|
|
if (digit <= 7)
|
|
|
|
break;
|
|
|
|
if (digit <= 9) {
|
|
|
|
numBase = BASH_BASE_OCTAL_ERROR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
} else if (numBase == BASH_BASE_ERROR) {
|
|
|
|
if (digit <= 9)
|
|
|
|
break;
|
|
|
|
} else { // DD#DDDD number style handling
|
|
|
|
if (digit != BASH_BASE_ERROR) {
|
|
|
|
if (numBase <= 36) {
|
|
|
|
// case-insensitive if base<=36
|
|
|
|
if (digit >= 36) digit -= 26;
|
|
|
|
}
|
|
|
|
if (digit < numBase)
|
|
|
|
break;
|
|
|
|
if (digit <= 9) {
|
|
|
|
numBase = BASH_BASE_ERROR;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// fallthrough when number is at an end or error
|
|
|
|
if (numBase == BASH_BASE_ERROR
|
|
|
|
#ifdef PEDANTIC_OCTAL
|
|
|
|
|| numBase == BASH_BASE_OCTAL_ERROR
|
|
|
|
#endif
|
|
|
|
) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.ChangeState(SCE_SH_ERROR | insideCommand);
|
2023-09-22 09:32:35 +00:00
|
|
|
} else if (digit < 62 || digit == 63 || (cmdState != CmdState::Arithmetic &&
|
|
|
|
(sc.ch == '-' || (sc.ch == '.' && sc.chNext != '.')))) {
|
|
|
|
// current character is alpha numeric, underscore, hyphen or dot
|
|
|
|
sc.ChangeState(SCE_SH_IDENTIFIER | insideCommand);
|
|
|
|
break;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
break;
|
|
|
|
case SCE_SH_COMMENTLINE:
|
2023-09-22 09:32:35 +00:00
|
|
|
if (sc.MatchLineEnd()) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SCE_SH_HERE_DELIM:
|
|
|
|
// From Bash info:
|
|
|
|
// ---------------
|
|
|
|
// Specifier format is: <<[-]WORD
|
|
|
|
// Optional '-' is for removal of leading tabs from here-doc.
|
|
|
|
// Whitespace acceptable after <<[-] operator
|
|
|
|
//
|
|
|
|
if (HereDoc.State == 0) { // '<<' encountered
|
|
|
|
HereDoc.Quote = sc.chNext;
|
|
|
|
HereDoc.Quoted = false;
|
2023-05-31 23:11:12 +00:00
|
|
|
HereDoc.Escaped = false;
|
2022-01-04 23:07:50 +00:00
|
|
|
HereDoc.DelimiterLength = 0;
|
|
|
|
HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0';
|
|
|
|
if (sc.chNext == '\'' || sc.chNext == '\"') { // a quoted here-doc delimiter (' or ")
|
|
|
|
sc.Forward();
|
|
|
|
HereDoc.Quoted = true;
|
|
|
|
HereDoc.State = 1;
|
|
|
|
} else if (setHereDoc.Contains(sc.chNext) ||
|
2023-05-31 23:11:12 +00:00
|
|
|
(sc.chNext == '=' && cmdState != CmdState::Arithmetic)) {
|
2022-01-04 23:07:50 +00:00
|
|
|
// an unquoted here-doc delimiter, no special handling
|
|
|
|
HereDoc.State = 1;
|
|
|
|
} else if (sc.chNext == '<') { // HERE string <<<
|
|
|
|
sc.Forward();
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.ForwardSetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (IsASpace(sc.chNext)) {
|
|
|
|
// eat whitespace
|
|
|
|
} else if (setLeftShift.Contains(sc.chNext) ||
|
2023-05-31 23:11:12 +00:00
|
|
|
(sc.chNext == '=' && cmdState == CmdState::Arithmetic)) {
|
2022-01-04 23:07:50 +00:00
|
|
|
// left shift <<$var or <<= cases
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.ChangeState(SCE_SH_OPERATOR | insideCommand);
|
|
|
|
sc.ForwardSetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else {
|
|
|
|
// symbols terminates; deprecated zero-length delimiter
|
|
|
|
HereDoc.State = 1;
|
|
|
|
}
|
|
|
|
} else if (HereDoc.State == 1) { // collect the delimiter
|
|
|
|
// * if single quoted, there's no escape
|
|
|
|
// * if double quoted, there are \\ and \" escapes
|
|
|
|
if ((HereDoc.Quote == '\'' && sc.ch != HereDoc.Quote) ||
|
|
|
|
(HereDoc.Quoted && sc.ch != HereDoc.Quote && sc.ch != '\\') ||
|
|
|
|
(HereDoc.Quote != '\'' && sc.chPrev == '\\') ||
|
|
|
|
(setHereDoc2.Contains(sc.ch))) {
|
|
|
|
HereDoc.Append(sc.ch);
|
|
|
|
} else if (HereDoc.Quoted && sc.ch == HereDoc.Quote) { // closing quote => end of delimiter
|
|
|
|
sc.ForwardSetState(SCE_SH_DEFAULT);
|
|
|
|
} else if (sc.ch == '\\') {
|
2023-05-31 23:11:12 +00:00
|
|
|
HereDoc.Escaped = true;
|
2022-01-04 23:07:50 +00:00
|
|
|
if (HereDoc.Quoted && sc.chNext != HereDoc.Quote && sc.chNext != '\\') {
|
|
|
|
// in quoted prefixes only \ and the quote eat the escape
|
|
|
|
HereDoc.Append(sc.ch);
|
|
|
|
} else {
|
|
|
|
// skip escape prefix
|
|
|
|
}
|
|
|
|
} else if (!HereDoc.Quoted) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { // force blowup
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_ERROR | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
HereDoc.State = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SCE_SH_SCALAR: // variable names
|
|
|
|
if (!setParam.Contains(sc.ch)) {
|
|
|
|
char s[500];
|
|
|
|
sc.GetCurrent(s, sizeof(s));
|
2023-05-31 23:11:12 +00:00
|
|
|
const int subStyle = classifierScalars.ValueFor(&s[1]); // skip the $
|
2022-01-04 23:07:50 +00:00
|
|
|
if (subStyle >= 0) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.ChangeState(subStyle | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
if (sc.LengthCurrent() == 1) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
// Special variable
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.Forward();
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(QuoteStack.State | insideCommand);
|
|
|
|
continue;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
break;
|
2023-05-31 23:11:12 +00:00
|
|
|
case SCE_SH_HERE_Q:
|
|
|
|
// HereDoc.State == 2
|
|
|
|
if (sc.atLineStart && QuoteStack.Current.Style == QuoteStyle::HereDoc) {
|
|
|
|
sc.SetState(SCE_SH_HERE_Q | insideCommand);
|
|
|
|
if (HereDoc.Indent) { // tabulation prefix
|
|
|
|
while (sc.ch == '\t') {
|
|
|
|
sc.Forward();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((static_cast<Sci_Position>(sc.currentPos + HereDoc.DelimiterLength) == sc.lineEnd) &&
|
|
|
|
(HereDoc.DelimiterLength == 0 || sc.Match(HereDoc.Delimiter))) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
if (HereDoc.DelimiterLength != 0) {
|
|
|
|
sc.SetState(SCE_SH_HERE_DELIM | insideCommand);
|
|
|
|
while (!sc.MatchLineEnd()) {
|
|
|
|
sc.Forward();
|
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
}
|
|
|
|
QuoteStack.Pop();
|
|
|
|
sc.SetState(SCE_SH_DEFAULT | QuoteStack.insideCommand);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (HereDoc.Quoted || HereDoc.Escaped) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// fall through to handle nested shell expansions
|
|
|
|
[[fallthrough]];
|
2022-01-04 23:07:50 +00:00
|
|
|
case SCE_SH_STRING: // delimited styles, can nest
|
2023-05-31 23:11:12 +00:00
|
|
|
case SCE_SH_PARAM: // ${parameter}
|
2022-01-04 23:07:50 +00:00
|
|
|
case SCE_SH_BACKTICKS:
|
2023-05-31 23:11:12 +00:00
|
|
|
if (sc.ch == '\\') {
|
|
|
|
if (QuoteStack.Current.Style != QuoteStyle::Literal)
|
2023-09-22 09:32:35 +00:00
|
|
|
QuoteStack.Escape(sc);
|
2023-05-31 23:11:12 +00:00
|
|
|
} else if (sc.ch == QuoteStack.Current.Down) {
|
|
|
|
if (QuoteStack.CountDown(sc, cmdState)) {
|
|
|
|
continue;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
} else if (sc.ch == QuoteStack.Current.Up) {
|
Updated to Scintilla 5.4.1 & Lexilla 5.3.0
Scintilla 5.4.1
https://www.scintilla.org/scintilla541.zip
Released 27 December 2023.
1. Add IDocumentEditable interface to allow efficient interaction with document objects which may not be visible in a Scintilla instance. This feature is provisonal and may change before being declared stable. For better type-safety, the ScintillaCall C++ API uses IDocumentEditable* where void* was used before which may require changes to client code that uses document pointer APIs DocPointer, SetDocPointer, CreateDocument, AddRefDocument, and ReleaseDocument.
2. Ctrl-click on a selection deselects it in multiple selection mode.
3. Add SCI_SELECTIONFROMPOINT for modifying multiple selections.
4. Add SCI_SETMOVEEXTENDSSELECTION and SCI_CHANGESELECTIONMODE to simplify selection mode manipulation.
5. Improve performance of global replace by reducing cache invalidation overhead. [Feature #1502](https://sourceforge.net/p/scintilla/feature-requests/1502/).
6. Fix regular expression search for "\<" matching beginning of search when not beginning of word and for "\>" not matching line end. [Bug #2157](https://sourceforge.net/p/scintilla/bugs/2157/).
7. Fix regular expression search failure when search for "\<" followed by search for "\>". [Bug #2413](https://sourceforge.net/p/scintilla/bugs/2413/).
8. Fix regular expression assertion (^, $, \b. \B) failures when using SCFIND_CXX11REGEX. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
9. Fix regular expression bug in reverse direction where shortened match returned. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
10. Avoid character fragments in regular expression search results. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/).
11. With a document that does not have the SC_DOCUMENTOPTION_TEXT_LARGE option set, allocating more than 2G (calling SCI_ALLOCATE or similar) will now fail with SC_STATUS_FAILURE.
12. Protect SCI_REPLACETARGET, SCI_REPLACETARGETMINIMAL, and SCI_REPLACETARGETRE from application changing target in notification handlers. [Bug #2289](https://sourceforge.net/p/scintilla/bugs/2289/).
Lexilla 5.3.0
https://www.scintilla.org/lexilla530.zip
Released 27 December 2023.
1. Fix calling AddStaticLexerModule by defining as C++ instead of C which matches header. [Bug #2421](https://sourceforge.net/p/scintilla/bugs/2421/).
2. Bash: Fix shift operator << incorrectly recognized as here-doc. [Issue #215](https://github.com/ScintillaOrg/lexilla/issues/215).
3. Bash: Fix termination of '${' with first unquoted '}' instead of nesting. [Issue #216](https://github.com/ScintillaOrg/lexilla/issues/216).
4. HTML: JavaScript double-quoted strings may escape line end with '\'. [Issue #214](https://github.com/ScintillaOrg/lexilla/issues/214).
5. Lua: recognize --- doc comments. Defined by [LDoc](https://github.com/lunarmodules/ldoc). Does not recognize --[[-- doc comments which seem less common.
Close #14375
2023-11-19 17:46:55 +00:00
|
|
|
if (QuoteStack.Current.Style != QuoteStyle::Parameter) {
|
|
|
|
QuoteStack.Current.Count++;
|
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
} else {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (QuoteStack.Current.Style == QuoteStyle::String ||
|
|
|
|
QuoteStack.Current.Style == QuoteStyle::HereDoc ||
|
|
|
|
QuoteStack.Current.Style == QuoteStyle::LString
|
|
|
|
) { // do nesting for "string", $"locale-string", heredoc
|
|
|
|
const bool stylingInside = options.stylingInside(MaskCommand(sc.state));
|
2022-01-04 23:07:50 +00:00
|
|
|
if (sc.ch == '`') {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Push(sc.ch, QuoteStyle::Backtick, sc.state, cmdState);
|
2023-05-31 23:11:12 +00:00
|
|
|
if (stylingInside) {
|
|
|
|
sc.SetState(SCE_SH_BACKTICKS | insideCommand);
|
|
|
|
}
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
} else if (sc.ch == '$' && !AnyOf(sc.chNext, '\"', '\'')) {
|
2023-05-31 23:11:12 +00:00
|
|
|
QuoteStack.Expand(sc, cmdState, stylingInside);
|
|
|
|
continue;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
} else if (QuoteStack.Current.Style == QuoteStyle::Command ||
|
|
|
|
QuoteStack.Current.Style == QuoteStyle::Parameter ||
|
|
|
|
QuoteStack.Current.Style == QuoteStyle::Backtick
|
|
|
|
) { // do nesting for $(command), `command`, ${parameter}
|
|
|
|
const bool stylingInside = options.stylingInside(MaskCommand(sc.state));
|
2022-01-04 23:07:50 +00:00
|
|
|
if (sc.ch == '\'') {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (stylingInside) {
|
|
|
|
QuoteStack.State = sc.state;
|
|
|
|
sc.SetState(SCE_SH_CHARACTER | insideCommand);
|
|
|
|
} else {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Push(sc.ch, QuoteStyle::Literal, sc.state, cmdState);
|
2023-05-31 23:11:12 +00:00
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (sc.ch == '\"') {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Push(sc.ch, QuoteStyle::String, sc.state, cmdState);
|
2023-05-31 23:11:12 +00:00
|
|
|
if (stylingInside) {
|
|
|
|
sc.SetState(SCE_SH_STRING | insideCommand);
|
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (sc.ch == '`') {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Push(sc.ch, QuoteStyle::Backtick, sc.state, cmdState);
|
2023-05-31 23:11:12 +00:00
|
|
|
if (stylingInside) {
|
|
|
|
sc.SetState(SCE_SH_BACKTICKS | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
2023-05-31 23:11:12 +00:00
|
|
|
} else if (sc.ch == '$') {
|
|
|
|
QuoteStack.Expand(sc, cmdState, stylingInside);
|
|
|
|
continue;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SCE_SH_CHARACTER: // singly-quoted strings
|
2023-05-31 23:11:12 +00:00
|
|
|
if (sc.ch == '\'') {
|
|
|
|
sc.ForwardSetState(QuoteStack.State | insideCommand);
|
|
|
|
continue;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Must check end of HereDoc state 1 before default state is handled
|
|
|
|
if (HereDoc.State == 1 && sc.MatchLineEnd()) {
|
|
|
|
// Begin of here-doc (the line after the here-doc delimiter):
|
|
|
|
// Lexically, the here-doc starts from the next line after the >>, but the
|
|
|
|
// first line of here-doc seem to follow the style of the last EOL sequence
|
|
|
|
HereDoc.State = 2;
|
|
|
|
if (HereDoc.Quoted) {
|
2023-05-31 23:11:12 +00:00
|
|
|
if (MaskCommand(sc.state) == SCE_SH_HERE_DELIM) {
|
2022-01-04 23:07:50 +00:00
|
|
|
// Missing quote at end of string! Syntax error in bash 4.3
|
|
|
|
// Mark this bit as an error, do not colour any here-doc
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.ChangeState(SCE_SH_ERROR | insideCommand);
|
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else {
|
|
|
|
// HereDoc.Quote always == '\''
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_HERE_Q | insideCommand);
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Start(-1, QuoteStyle::HereDoc, SCE_SH_DEFAULT, cmdState);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
} else if (HereDoc.DelimiterLength == 0) {
|
|
|
|
// no delimiter, illegal (but '' and "" are legal)
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.ChangeState(SCE_SH_ERROR | insideCommand);
|
|
|
|
sc.SetState(SCE_SH_DEFAULT | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_HERE_Q | insideCommand);
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Start(-1, QuoteStyle::HereDoc, SCE_SH_DEFAULT, cmdState);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// update cmdState about the current command segment
|
2023-05-31 23:11:12 +00:00
|
|
|
if (stylePrev != SCE_SH_DEFAULT && MaskCommand(sc.state) == SCE_SH_DEFAULT) {
|
2022-01-04 23:07:50 +00:00
|
|
|
cmdState = cmdStateNew;
|
|
|
|
}
|
|
|
|
// Determine if a new state should be entered.
|
2023-05-31 23:11:12 +00:00
|
|
|
if (MaskCommand(sc.state) == SCE_SH_DEFAULT) {
|
2022-01-04 23:07:50 +00:00
|
|
|
if (sc.ch == '\\') {
|
|
|
|
// Bash can escape any non-newline as a literal
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_IDENTIFIER | insideCommand);
|
2023-09-22 09:32:35 +00:00
|
|
|
QuoteStack.Escape(sc);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (IsADigit(sc.ch)) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_NUMBER | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
numBase = BASH_BASE_DECIMAL;
|
|
|
|
if (sc.ch == '0') { // hex,octal
|
|
|
|
if (sc.chNext == 'x' || sc.chNext == 'X') {
|
|
|
|
numBase = BASH_BASE_HEX;
|
|
|
|
sc.Forward();
|
|
|
|
} else if (IsADigit(sc.chNext)) {
|
|
|
|
#ifdef PEDANTIC_OCTAL
|
|
|
|
numBase = BASH_BASE_OCTAL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (setWordStart.Contains(sc.ch)) {
|
2023-09-22 09:32:35 +00:00
|
|
|
sc.SetState(((cmdState == CmdState::Arithmetic)? SCE_SH_IDENTIFIER : SCE_SH_WORD) | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (sc.ch == '#') {
|
|
|
|
if (stylePrev != SCE_SH_WORD && stylePrev != SCE_SH_IDENTIFIER &&
|
|
|
|
(sc.currentPos == 0 || setMetaCharacter.Contains(sc.chPrev))) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_COMMENTLINE | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_WORD | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
// handle some zsh features within arithmetic expressions only
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Arithmetic) {
|
2022-01-04 23:07:50 +00:00
|
|
|
if (sc.chPrev == '[') { // [#8] [##8] output digit setting
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_WORD | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
if (sc.chNext == '#') {
|
|
|
|
sc.Forward();
|
|
|
|
}
|
|
|
|
} else if (sc.Match("##^") && IsUpperCase(sc.GetRelative(3))) { // ##^A
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_IDENTIFIER | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
sc.Forward(3);
|
|
|
|
} else if (sc.chNext == '#' && !IsASpace(sc.GetRelative(2))) { // ##a
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_IDENTIFIER | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
sc.Forward(2);
|
|
|
|
} else if (setWordStart.Contains(sc.chNext)) { // #name
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_IDENTIFIER | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (sc.ch == '\"') {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_STRING | insideCommand);
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Start(sc.ch, QuoteStyle::String, SCE_SH_DEFAULT, cmdState);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (sc.ch == '\'') {
|
2023-05-31 23:11:12 +00:00
|
|
|
QuoteStack.State = SCE_SH_DEFAULT;
|
|
|
|
sc.SetState(SCE_SH_CHARACTER | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (sc.ch == '`') {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_BACKTICKS | insideCommand);
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
QuoteStack.Start(sc.ch, QuoteStyle::Backtick, SCE_SH_DEFAULT, cmdState);
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (sc.ch == '$') {
|
2023-05-31 23:11:12 +00:00
|
|
|
QuoteStack.Expand(sc, cmdState, true);
|
|
|
|
continue;
|
|
|
|
} else if (cmdState != CmdState::Arithmetic && sc.Match('<', '<')) {
|
|
|
|
sc.SetState(SCE_SH_HERE_DELIM | insideCommand);
|
2022-01-04 23:07:50 +00:00
|
|
|
HereDoc.State = 0;
|
|
|
|
if (sc.GetRelative(2) == '-') { // <<- indent case
|
|
|
|
HereDoc.Indent = true;
|
|
|
|
sc.Forward();
|
|
|
|
} else {
|
|
|
|
HereDoc.Indent = false;
|
|
|
|
}
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
} else if (sc.ch == '-' && // test operator or short and long option
|
2023-09-22 09:32:35 +00:00
|
|
|
cmdState != CmdState::Arithmetic &&
|
|
|
|
sc.chPrev != '~' && !IsADigit(sc.chNext)) {
|
|
|
|
if (IsASpace(sc.chPrev) || setMetaCharacter.Contains(sc.chPrev)) {
|
|
|
|
sc.SetState(SCE_SH_WORD | insideCommand);
|
|
|
|
} else {
|
|
|
|
sc.SetState(SCE_SH_IDENTIFIER | insideCommand);
|
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
} else if (setBashOperator.Contains(sc.ch)) {
|
|
|
|
bool isCmdDelim = false;
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_OPERATOR | insideCommand);
|
|
|
|
// arithmetic expansion and command substitution
|
|
|
|
if (QuoteStack.Current.Style == QuoteStyle::Arithmetic || QuoteStack.Current.Style == QuoteStyle::CommandInside) {
|
|
|
|
if (sc.ch == QuoteStack.Current.Down) {
|
|
|
|
if (QuoteStack.CountDown(sc, cmdState)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
} else if (sc.ch == QuoteStack.Current.Up) {
|
|
|
|
QuoteStack.Current.Count++;
|
|
|
|
}
|
|
|
|
}
|
2022-01-04 23:07:50 +00:00
|
|
|
// globs have no whitespace, do not appear in arithmetic expressions
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState != CmdState::Arithmetic && sc.ch == '(' && sc.chNext != '(') {
|
|
|
|
const int i = GlobScan(sc);
|
2022-01-04 23:07:50 +00:00
|
|
|
if (i > 1) {
|
2023-05-31 23:11:12 +00:00
|
|
|
sc.SetState(SCE_SH_IDENTIFIER | insideCommand);
|
|
|
|
sc.Forward(i + 1);
|
2022-01-04 23:07:50 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// handle opening delimiters for test/arithmetic expressions - ((,[[,[
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Start
|
|
|
|
|| cmdState == CmdState::Body) {
|
2022-01-04 23:07:50 +00:00
|
|
|
if (sc.Match('(', '(')) {
|
2023-05-31 23:11:12 +00:00
|
|
|
cmdState = CmdState::Arithmetic;
|
2022-01-04 23:07:50 +00:00
|
|
|
sc.Forward();
|
|
|
|
} else if (sc.Match('[', '[') && IsASpace(sc.GetRelative(2))) {
|
2023-09-22 09:32:35 +00:00
|
|
|
cmdState = CmdState::DoubleBracket;
|
2022-01-04 23:07:50 +00:00
|
|
|
sc.Forward();
|
|
|
|
} else if (sc.ch == '[' && IsASpace(sc.chNext)) {
|
2023-09-22 09:32:35 +00:00
|
|
|
cmdState = CmdState::SingleBracket;
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// special state -- for ((x;y;z)) in ... looping
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Word && sc.Match('(', '(')) {
|
|
|
|
cmdState = CmdState::Arithmetic;
|
|
|
|
sc.Forward(2);
|
2022-01-04 23:07:50 +00:00
|
|
|
continue;
|
|
|
|
}
|
2023-09-22 09:32:35 +00:00
|
|
|
// handle command delimiters in command Start|Body|Word state, also Test if 'test' or '[]'
|
|
|
|
if (cmdState < CmdState::DoubleBracket) {
|
2023-05-31 23:11:12 +00:00
|
|
|
char s[10];
|
2022-01-04 23:07:50 +00:00
|
|
|
s[0] = static_cast<char>(sc.ch);
|
|
|
|
if (setBashOperator.Contains(sc.chNext)) {
|
|
|
|
s[1] = static_cast<char>(sc.chNext);
|
|
|
|
s[2] = '\0';
|
|
|
|
isCmdDelim = cmdDelimiter.InList(s);
|
|
|
|
if (isCmdDelim)
|
|
|
|
sc.Forward();
|
|
|
|
}
|
|
|
|
if (!isCmdDelim) {
|
|
|
|
s[1] = '\0';
|
|
|
|
isCmdDelim = cmdDelimiter.InList(s);
|
|
|
|
}
|
|
|
|
if (isCmdDelim) {
|
2023-05-31 23:11:12 +00:00
|
|
|
cmdState = CmdState::Delimiter;
|
|
|
|
sc.Forward();
|
2022-01-04 23:07:50 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// handle closing delimiters for test/arithmetic expressions - )),]],]
|
2023-05-31 23:11:12 +00:00
|
|
|
if (cmdState == CmdState::Arithmetic && sc.Match(')', ')')) {
|
|
|
|
cmdState = CmdState::Body;
|
2022-01-04 23:07:50 +00:00
|
|
|
sc.Forward();
|
2023-09-22 09:32:35 +00:00
|
|
|
} else if (sc.ch == ']' && IsASpace(sc.chPrev)) {
|
|
|
|
if (cmdState == CmdState::SingleBracket) {
|
2023-05-31 23:11:12 +00:00
|
|
|
cmdState = CmdState::Body;
|
2023-09-22 09:32:35 +00:00
|
|
|
} else if (cmdState == CmdState::DoubleBracket && sc.chNext == ']') {
|
2023-05-31 23:11:12 +00:00
|
|
|
cmdState = CmdState::Body;
|
2023-09-22 09:32:35 +00:00
|
|
|
sc.Forward();
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}// sc.state
|
2023-05-31 23:11:12 +00:00
|
|
|
|
|
|
|
sc.Forward();
|
2022-01-04 23:07:50 +00:00
|
|
|
}
|
|
|
|
sc.Complete();
|
2023-05-31 23:11:12 +00:00
|
|
|
if (MaskCommand(sc.state) == SCE_SH_HERE_Q) {
|
2022-01-04 23:07:50 +00:00
|
|
|
styler.ChangeLexerState(sc.currentPos, styler.Length());
|
|
|
|
}
|
|
|
|
sc.Complete();
|
|
|
|
}
|
|
|
|
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
void SCI_METHOD LexerBash::Fold(Sci_PositionU startPos_, Sci_Position length, int initStyle, IDocument *pAccess) {
|
2022-01-04 23:07:50 +00:00
|
|
|
if(!options.fold)
|
|
|
|
return;
|
|
|
|
|
|
|
|
LexAccessor styler(pAccess);
|
|
|
|
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
const Sci_Position startPos = startPos_;
|
|
|
|
const Sci_Position endPos = startPos + length;
|
2022-01-04 23:07:50 +00:00
|
|
|
int visibleChars = 0;
|
|
|
|
Sci_Position lineCurrent = styler.GetLine(startPos);
|
|
|
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
|
|
|
int levelCurrent = levelPrev;
|
|
|
|
char chNext = styler[startPos];
|
2023-05-31 23:11:12 +00:00
|
|
|
int styleNext = MaskCommand(styler.StyleIndexAt(startPos));
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
int style = MaskCommand(initStyle);
|
2022-01-04 23:07:50 +00:00
|
|
|
char word[8] = { '\0' }; // we're not interested in long words anyway
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
size_t wordlen = 0;
|
|
|
|
for (Sci_Position i = startPos; i < endPos; i++) {
|
2023-05-31 23:11:12 +00:00
|
|
|
const char ch = chNext;
|
2022-01-04 23:07:50 +00:00
|
|
|
chNext = styler.SafeGetCharAt(i + 1);
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
const int stylePrev = style;
|
|
|
|
style = styleNext;
|
2023-05-31 23:11:12 +00:00
|
|
|
styleNext = MaskCommand(styler.StyleIndexAt(i + 1));
|
|
|
|
const bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
2022-01-04 23:07:50 +00:00
|
|
|
// Comment folding
|
|
|
|
if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler))
|
|
|
|
{
|
|
|
|
if (!IsCommentLine(lineCurrent - 1, styler)
|
|
|
|
&& IsCommentLine(lineCurrent + 1, styler))
|
|
|
|
levelCurrent++;
|
|
|
|
else if (IsCommentLine(lineCurrent - 1, styler)
|
|
|
|
&& !IsCommentLine(lineCurrent + 1, styler))
|
|
|
|
levelCurrent--;
|
|
|
|
}
|
|
|
|
if (style == SCE_SH_WORD) {
|
|
|
|
if ((wordlen + 1) < sizeof(word))
|
|
|
|
word[wordlen++] = ch;
|
|
|
|
if (styleNext != style) {
|
|
|
|
word[wordlen] = '\0';
|
|
|
|
wordlen = 0;
|
|
|
|
if (strcmp(word, "if") == 0 || strcmp(word, "case") == 0 || strcmp(word, "do") == 0) {
|
|
|
|
levelCurrent++;
|
|
|
|
} else if (strcmp(word, "fi") == 0 || strcmp(word, "esac") == 0 || strcmp(word, "done") == 0) {
|
|
|
|
levelCurrent--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (style == SCE_SH_OPERATOR) {
|
|
|
|
if (ch == '{') {
|
|
|
|
levelCurrent++;
|
|
|
|
} else if (ch == '}') {
|
|
|
|
levelCurrent--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Here Document folding
|
|
|
|
if (style == SCE_SH_HERE_DELIM) {
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
if (stylePrev == SCE_SH_HERE_Q) {
|
|
|
|
levelCurrent--;
|
|
|
|
} else if (stylePrev != SCE_SH_HERE_DELIM) {
|
|
|
|
if (ch == '<' && chNext == '<') {
|
|
|
|
if (styler.SafeGetCharAt(i + 2) != '<') {
|
2022-01-04 23:07:50 +00:00
|
|
|
levelCurrent++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
Update: Scintilla 5.3.6 and Lexilla 5.2.6
update to Scinitlla Release 5.3.6 (https://www.scintilla.org/scintilla536.zip)
Released 26 July 2023.
Redraw calltip after showing as didn't update when size of new text exactly same as previous. Feature #1486.
On Win32 fix reverse arrow cursor when scaled. Bug #2382.
On Win32 hide cursor when typing if that system preference has been chosen. Bug #2333.
On Win32 and Qt, stop aligning IME candidate window to target. It is now always aligned to start of composition string. This undoes part of feature #1300. Feature #1488, Bug #2391, Feature #1300.
On Qt, for IMEs, update micro focus when selection changes. This may move the location of IME popups to align with the caret.
On Qt, implement replacement for IMEs which may help with actions like reconversion. This is similar to delete-surrounding on GTK.
and Lexilla Release 5.2.6 (https://www.scintilla.org/lexilla526.zip)
Released 26 July 2023.
Include empty word list names in value returned by DescribeWordListSets and SCI_DESCRIBEKEYWORDSETS. Issue #175, Pull request #176.
Bash: style here-doc end delimiters as SCE_SH_HERE_DELIM instead of SCE_SH_HERE_Q. Issue #177.
Bash: allow '$' as last character in string. Issue #180, Pull request #181.
Bash: fix state after expansion. Highlight all numeric and file test operators. Don't highlight dash in long option as operator. Issue #182, Pull request #183.
Bash: strict checking of special parameters ($*, $@, $$, ...) with property lexer.bash.special.parameter to specify valid parameters. Issue #184, Pull request #186.
Bash: recognize keyword before redirection operators (< and >). Issue #188, Pull request #189.
Errorlist: recognize Bash diagnostic messages.
HTML: allow ASP block to terminate inside line comment. Issue #185.
HTML: fix folding with JSP/ASP.NET <%-- comment. Issue #191.
HTML: fix incremental styling of multi-line ASP.NET directive. Issue #191.
Matlab: improve arguments blocks. Add support for multiple arguments blocks. Prevent "arguments" from being keyword in function declaration line. Fix semicolon handling. Pull request #179.
Visual Prolog: add support for embedded syntax with SCE_VISUALPROLOG_EMBEDDED and SCE_VISUALPROLOG_PLACEHOLDER.
Styling of string literals changed with no differentiation between literals with quotes and those that are prefixed with "@". Quote characters are in a separate style (SCE_VISUALPROLOG_STRING_QUOTE) to contents (SCE_VISUALPROLOG_STRING).
SCE_VISUALPROLOG_CHARACTER, SCE_VISUALPROLOG_CHARACTER_TOO_MANY, SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR, SCE_VISUALPROLOG_STRING_EOL_OPEN, and SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL were removed (replaced with SCE_VISUALPROLOG_UNUSED[1-5]). Pull request #178.
Fix #13901, fix #13911, fix #13943, close #13940
2023-07-27 17:57:12 +00:00
|
|
|
} else if (style == SCE_SH_HERE_Q && styleNext == SCE_SH_DEFAULT) {
|
2022-01-04 23:07:50 +00:00
|
|
|
levelCurrent--;
|
|
|
|
}
|
|
|
|
if (atEOL) {
|
|
|
|
int lev = levelPrev;
|
|
|
|
if (visibleChars == 0 && options.foldCompact)
|
|
|
|
lev |= SC_FOLDLEVELWHITEFLAG;
|
|
|
|
if ((levelCurrent > levelPrev) && (visibleChars > 0))
|
|
|
|
lev |= SC_FOLDLEVELHEADERFLAG;
|
|
|
|
if (lev != styler.LevelAt(lineCurrent)) {
|
|
|
|
styler.SetLevel(lineCurrent, lev);
|
|
|
|
}
|
|
|
|
lineCurrent++;
|
|
|
|
levelPrev = levelCurrent;
|
|
|
|
visibleChars = 0;
|
|
|
|
}
|
|
|
|
if (!isspacechar(ch))
|
|
|
|
visibleChars++;
|
|
|
|
}
|
|
|
|
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
|
2023-05-31 23:11:12 +00:00
|
|
|
const int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
|
2022-01-04 23:07:50 +00:00
|
|
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
|
|
|
}
|
|
|
|
|
|
|
|
LexerModule lmBash(SCLEX_BASH, LexerBash::LexerFactoryBash, "bash", bashWordListDesc);
|