From 0f5b74a4a173d3b780e6e387914c11d997f591bb Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sun, 19 Nov 2023 17:56:17 +0100 Subject: [PATCH] [ShellScript] Add declare -I Fixes #3872 --- ShellScript/Bash.sublime-syntax | 4 ++-- ShellScript/test/syntax_test_bash.sh | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ShellScript/Bash.sublime-syntax b/ShellScript/Bash.sublime-syntax index a5c8d5e9d8..1343166b1a 100644 --- a/ShellScript/Bash.sublime-syntax +++ b/ShellScript/Bash.sublime-syntax @@ -510,7 +510,7 @@ contexts: - include: immediately-pop cmd-declare-args: - - match: ([-+])(?:[aAgilnrtux]*[Ff][aAgilnrtux]*) + - match: ([-+])(?:[aAgiIlnrtux]*[Ff][aAgiIlnrtux]*) scope: meta.parameter.option.shell variable.parameter.option.shell @@ -528,7 +528,7 @@ contexts: - include: cmd-args-end-of-options-then-variables cmd-declare-options: - - match: ([-+])(?:[aAgilnrtux]+|p) + - match: ([-+])(?:[aAgiIlnrtux]+|p) scope: meta.parameter.option.shell variable.parameter.option.shell diff --git a/ShellScript/test/syntax_test_bash.sh b/ShellScript/test/syntax_test_bash.sh index 12798eb560..f9fd25f47e 100755 --- a/ShellScript/test/syntax_test_bash.sh +++ b/ShellScript/test/syntax_test_bash.sh @@ -1463,6 +1463,12 @@ declare -A foo bar # 'foo' and 'bar' are variable names # ^ - meta.declaration.variable # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.number-sign.shell +declare -I foo +#^^^^^^ meta.declaration.variable.shell +# ^^^^^^^ meta.declaration.variable.arguments.shell +# ^^ variable.parameter.option.shell +# ^^^ variable.other.readwrite.shell + declare ret; bar=foo # comment #^^^^^^ meta.declaration.variable.shell # ^^^^ meta.declaration.variable.arguments.shell