Skip to content

Commit

Permalink
[ShellScript] Fix redirection after function definition body
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Oct 12, 2024
1 parent fdf73d4 commit d76a689
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ShellScript/Bash.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ contexts:

def-function-end:
- include: eoc-pop
- include: redirections
- include: illegal-words

###[ VARIABLE DEFINITIONS ]####################################################
Expand Down
9 changes: 9 additions & 0 deletions ShellScript/Bash/tests/syntax_test_scope.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2882,6 +2882,15 @@ function () ; {} arg
# ^ meta.function.shell
# ^^ meta.function.body.shell meta.block.shell

func () {} >&2 # comment
#^ source.shell - meta.function
# ^^^^^ meta.function.identifier.shell
# ^^ meta.function.parameters.shell
# ^ meta.function.shell
# ^^ meta.function.body.shell meta.block.shell
# ^^^ meta.redirection.shell
# ^^^^^^^^^^ comment.line.number-sign.shell

func () {} rest # comment
#^ source.shell - meta.function
# ^^^^^ meta.function.identifier.shell
Expand Down

0 comments on commit d76a689

Please sign in to comment.