From 144279ef30a432ac8416746e3491f3120ae9b4e8 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 3 Feb 2023 09:18:18 +0100 Subject: vim-patch:be4e01637e71 (#22103) Update runtime files. https://github.com/vim/vim/commit/be4e01637e71c8d5095c33b9861fd70b41476732 Co-authored-by: Bram Moolenaar --- runtime/syntax/sh.vim | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'runtime/syntax/sh.vim') diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 6722d62c89..13d74dbc17 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Nov 25, 2022 -" Version: 204 +" Last Change: Dec 20, 2022 +" Version: 205 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras @@ -190,8 +190,10 @@ syn region shEmbeddedEcho contained matchgroup=shStatement start="\" ski " ===== if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") syn match shStatement "\" - syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`" - syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="=" + syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]*\)\@=" skip="\\$" end="\>\|`" + syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]*=\)\@=" skip="\\$" end="=" +" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`" +" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="=" " Touch: {{{1 " ===== @@ -333,7 +335,7 @@ syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shComment " systems too, however, so the following syntax will flag $(..) as " an Error under /bin/sh. By consensus of vimdev'ers! if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") - syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList + syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]\|$" skip='\\\\\|\\.' end=")" contains=@shCommandSubList syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList syn match shSkipInitWS contained "^\s\+" @@ -483,7 +485,9 @@ endif " Parameter Dereferencing: {{{1 " ======================== -if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix")) +" Note: sh04 failure with following line +"if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix")) +if !exists("g:sh_no_error") syn match shDerefWordError "[^}$[~]" contained endif syn match shDerefSimple "\$\%(\h\w*\|\d\)" nextgroup=@shNoZSList -- cgit From 66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 28 Feb 2023 09:34:27 +0100 Subject: vim-patch:partial:dd60c365cd26 (#22437) vim-patch:partial:dd60c365cd26 Update runtime files https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97 Co-authored-by: Bram Moolenaar Skip: eval.txt, repeat.txt (needs `getscriptinfo()`) --- runtime/syntax/sh.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'runtime/syntax/sh.vim') diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 13d74dbc17..f455f19c93 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Dec 20, 2022 -" Version: 205 +" Last Change: Feb 11, 2023 +" Version: 207 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras @@ -166,7 +166,7 @@ if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shLoopoList add=shForPP endif syn cluster shPPSLeftList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable -syn cluster shPPSRightList contains=shComment,shDeref,shDerefSimple,shEscape,shPosnParm +syn cluster shPPSRightList contains=shDeref,shDerefSimple,shEscape,shPosnParm syn cluster shSubShList contains=@shCommandSubList,shCommandSubBQ,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator syn cluster shTestList contains=shArithmetic,shCharClass,shCommandSub,shCommandSubBQ,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shSpecialDQ,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr syn cluster shNoZSList contains=shSpecialNoZS @@ -335,7 +335,7 @@ syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shComment " systems too, however, so the following syntax will flag $(..) as " an Error under /bin/sh. By consensus of vimdev'ers! if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") - syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]\|$" skip='\\\\\|\\.' end=")" contains=@shCommandSubList + syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList syn match shSkipInitWS contained "^\s\+" @@ -503,7 +503,6 @@ endif " ksh: ${.sh.*} variables: {{{1 " ======================================== if exists("b:is_kornshell") -" syn match shDerefVar contained "[.]*" nextgroup=@shDerefVarList syn match shDerefVar contained "\.\+" nextgroup=@shDerefVarList endif @@ -548,6 +547,7 @@ syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" co " bash : ${parameter,pattern} Case modification " bash : ${parameter,,pattern} Case modification " bash : ${@:start:qty} display command line arguments from start to start+qty-1 (inferred) +" bash : ${parameter@operator} transforms parameter (operator∈[uULqEPARa]) syn cluster shDerefPatternList contains=shDerefPattern,shDerefString if !exists("g:sh_no_error") syn match shDerefOpError contained ":[[:punct:]]" @@ -563,6 +563,7 @@ if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix") endif if exists("b:is_bash") syn match shDerefOp contained "[,^]\{1,2}" nextgroup=@shDerefPatternList + syn match shDerefOp contained "@[uULQEPAKa]" endif syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@ Date: Sun, 23 Apr 2023 15:22:55 +0200 Subject: vim-patch:71badf9547e8 (#23285) Update runtime files https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528 Co-authored-by: Bram Moolenaar --- runtime/syntax/sh.vim | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'runtime/syntax/sh.vim') diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index f455f19c93..8674ded9e4 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Feb 11, 2023 -" Version: 207 +" Last Change: Feb 28, 2023 +" Version: 208 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras @@ -415,21 +415,21 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup " (modified by Felipe Contreras) " ========================================= ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\s*\z1$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\t*\z1$" contains=@shDblQuoteList ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\z1$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\s*\z1$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\t*\z1$" ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\t*\z1$" ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\t*\z1$" ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc09 end="^\z1$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\t*\z1$" contains=@shDblQuoteList ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\t*\z1$" ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc13 end="^\z1$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\t*\z1$" ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc15 end="^\z1$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\t*\z1$" " Here Strings: {{{1 -- cgit From a5629abce29668e9781768986f7e799ba429f017 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 28 Oct 2023 23:53:08 +0200 Subject: vim-patch:a390e984db20 runtime(sh): add shDblParen to shLoopList for bash (vim/vim#13445) add shDblParen to shLoopList to correctly highlight arithmetic expressions for Bash and Ksh This should allow code such as: ```bash declare -i i j for i in foo bar do ((j = 1 << j)) done ``` https://github.com/vim/vim/commit/a390e984db20575dc726b4e0ebf95582265df8e7 Co-authored-by: Lucien Grondin --- runtime/syntax/sh.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/syntax/sh.vim') diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 8674ded9e4..d64c3a9b08 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -163,7 +163,7 @@ syn cluster shIdList contains=shArithmetic,shCommandSub,shCommandSubBQ,shWrapLin syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shIf,shOption,shSet,shTest,shTestOpr,shTouch if exists("b:is_kornshell") || exists("b:is_bash") - syn cluster shLoopoList add=shForPP + syn cluster shLoopList add=shForPP,shDblParen endif syn cluster shPPSLeftList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shPPSRightList contains=shDeref,shDerefSimple,shEscape,shPosnParm -- cgit From d4dc1355eda78ca2a8aece08d1ab6c6bc1e91505 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 3 Nov 2023 00:20:56 +0100 Subject: vim-patch:1858e2b22ad1 runtime(sh) Update sh syntax and add shDblParen to shCaseList (vim/vim#13469) https://github.com/vim/vim/commit/1858e2b22ad168b1fd44a4efcd3a2b6cd9f6772d Co-authored-by: Lucien Grondin --- runtime/syntax/sh.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/syntax/sh.vim') diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index d64c3a9b08..0fb10f0e51 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -140,7 +140,7 @@ syn cluster shArithList contains=@shArithParenList,shParenError syn cluster shCaseEsacList contains=shCaseStart,shCaseLabel,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSubBQ,shComment,shDblBrace,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq if exists("b:is_kornshell") || exists("b:is_bash") - syn cluster shCaseList add=shForPP + syn cluster shCaseList add=shForPP,shDblParen endif syn cluster shCommandSubList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shComment,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial -- cgit From d3e9cbedc700a5ae9f64fdced07cdddbb4ef13d1 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 4 Nov 2023 11:39:42 +0100 Subject: vim-patch:ce3b0136c6d9 runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash (vim/vim#13480) Add shDerefOffset to shDerefVarArray. Example code: ```bash declare -a a=({a..z}) echo "${a[@]:1:3}" ``` https://github.com/vim/vim/commit/ce3b0136c6d9d09af41969d3dc9634f115505a32 Co-authored-by: Lucien Grondin --- runtime/syntax/sh.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/syntax/sh.vim') diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 0fb10f0e51..e2b1947197 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -531,7 +531,7 @@ if exists("b:is_kornshell") || exists("b:is_posix") endif " sh ksh bash : ${var[... ]...} array reference: {{{1 -syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError +syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError,shDerefOffset " Special ${parameter OPERATOR word} handling: {{{1 " sh ksh bash : ${parameter:-word} word is default value -- cgit