aboutsummaryrefslogtreecommitdiff
path: root/scripts/lintcommit.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2026-03-25 07:12:08 +0800
committerzeertzjq <zeertzjq@outlook.com>2026-03-25 07:38:21 +0800
commitcedafc86df236c7ad31ffd71394c3b252d9137ab (patch)
tree821397c180df04dce9dc89da11a2ca0e435ad3c3 /scripts/lintcommit.lua
parentb02d1303b80f18f482b9eee94f1f29245c9da69f (diff)
downloadrneovim-cedafc86df236c7ad31ffd71394c3b252d9137ab.tar.gz
rneovim-cedafc86df236c7ad31ffd71394c3b252d9137ab.tar.bz2
rneovim-cedafc86df236c7ad31ffd71394c3b252d9137ab.zip
vim-patch:9c0d057: runtime(sh): Improve the matching of function definitions
- Drop the remaining undefined "shFunctionStart" references (gone in v7.2b.000, c236c16d0). - Revise nestable contexts where function definitions are supported: * Stop looking for function definitions in arithmetic expressions. * Recognise function definitions enclosing other function definitions. - In addition to grouping commands "{}" and "()", also match other compound commands (e.g. "if"; see "shFunctionCmd*") whenever these commands are supported as complete function bodies. - Balance body delimiters "(" and ")" for "shFunctionFour" in Bash; match such function bodies whenever the use of the function parameter list "()" token is optional, i.e. when the "function" reserved word is present. - Enable the use of "shFunctionFour" definitions. - Do not claim optional leading whitespace characters before a matched function definition. - Prefer patterns with ASCII atoms (e.g. "\h") to equivalent collections (e.g. "[A-Za-z_]") for speed. - Accommodate word-boundary assertions in function name patterns to names that may start and/or end with supported non-word characters, e.g. "@test:". - Match more valid function names in Bash: non-ASCII names, non-word names. - Allow for function names with "do", "done", etc. prefixes; confine these name checks to "shDoError" and "shIfError". fixes: vim/vim#19619 related: vim/vim#19638 References: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_04 https://gitweb.git.savannah.gnu.org/gitweb/?p=bash.git;a=blob_plain;f=doc/bash.html;hb=637f5c8696a6adc9b4519f1cd74aa78492266b7f https://web.archive.org/web/20151105130220/http://www.research.att.com/sw/download/man/man1/ksh88.html https://web.archive.org/web/20151025145158/http://www2.research.att.com/sw/download/man/man1/ksh.html http://www.mirbsd.org/htman/i386/man1/mksh.htm https://github.com/vim/vim/commit/9c0d057e3d5a456b2f2879860e5e57bcdf130017 Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com> Co-authored-by: Johnothan King <johnothanking@protonmail.com> Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat (limited to 'scripts/lintcommit.lua')
0 files changed, 0 insertions, 0 deletions