Skip to content

Commit

Permalink
[ShellScript] Add declare -I
Browse files Browse the repository at this point in the history
Fixes #3872
  • Loading branch information
deathaxe committed Nov 19, 2023
1 parent 636539f commit 0f5b74a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ShellScript/Bash.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ShellScript/test/syntax_test_bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f5b74a

Please sign in to comment.