[sh] Allow more characters in aliases and function names
Which characters are allowed? - Aliases: https://www.gnu.org/software/bash/manual/html_node/Aliases.html - Functions: https://unix.stackexchange.com/questions/245331/shell-valid-function-name-characters For aliases I chose [\w-.] instead of blacklisting many forbidden characters. For functions I chose \S.
This commit is contained in:
parent
c6eb9bd8f0
commit
75bb796b2b
|
@ -56,7 +56,8 @@ evaluate-commands %sh{
|
|||
|
||||
add-highlighter shared/sh/code/operators regex [\[\]\(\)&|]{1,2} 0:operator
|
||||
add-highlighter shared/sh/code/variable regex ((?<![-:])\b\w+)= 1:variable
|
||||
add-highlighter shared/sh/code/function regex ^\h*(\w+)\h*\(\) 1:function
|
||||
add-highlighter shared/sh/code/alias regex \balias(\h+[-+]\w)*\h+([\w-.]+)= 2:variable
|
||||
add-highlighter shared/sh/code/function regex ^\h*(\S+)\h*\(\) 1:function
|
||||
|
||||
add-highlighter shared/sh/code/unscoped_expansion regex \$(\w+|#|@|\?|\$|!|-|\*) 0:value
|
||||
add-highlighter shared/sh/double_string/expansion regex \$(\w+|\{.+?\}) 0:value
|
||||
|
|
Loading…
Reference in New Issue
Block a user