[PATCH 0/8] syntax: sh: heredoc fixes

37 views
Skip to first unread message

Felipe Contreras

unread,
Jun 13, 2019, 6:13:17 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
Hi,

There are a lot of issues with the sh syntax for heredoc, these patches
attempt to solve them. I counted at least five bugs fixed.

You can open this file and see for yourself.

double='DDOUBLE'

# 01
cat <<EOF
this is $double
EOF
cat << EOF
this is $double
EOF

# 02
cat <<-EOF
this is $double
EOF
cat <<- EOF
this is $double
EOF

# 03
cat <<\EOF
this is $single
EOF
# BUG 2
cat << \EOF
this is $single
EOF

# 04
# BUG 1
cat <<-\EOF
this is $single
EOF
cat <<- \EOF
this is $single
EOF

# 05
cat <<'EOF'
this is $single
EOF
cat << 'EOF'
this is $single
EOF

# 06
cat <<-'EOF'
this is $single
EOF
cat <<- 'EOF'
this is $single
EOF

# 07
cat <<"EOF"
this is $single
EOF
cat << "EOF"
this is $single
EOF

# 08
cat <<-"EOF"
this is $single
EOF
cat <<- "EOF"
this is $single
EOF

# 09
cat <<\
EOF
this is $double
EOF
cat <<\
EOF
this is $double
EOF

# 10
# BUG 3
cat <<-\
EOF
this is $double
EOF
cat <<- \
EOF
this is $double
EOF

# BUG 4
# 11
cat <<\
\EOF
this is $single
EOF
cat << \
\EOF
this is $single
EOF

# 12
cat <<-\
\EOF
this is $single
EOF
cat <<- \
\EOF
this is $single
EOF

# 13
cat <<\
'EOF'
this is $single
EOF
# BUG 5
cat <<\
'E O F'
this is $single
E O F
cat << \
'E O F'
this is $single
E O F

# 14
cat <<-\
'EOF'
this is $single
EOF
cat <<-\
'E O F'
this is $single
E O F
cat <<- \
'E O F'
this is $single
E O F

# 15
cat <<\
"EOF"
this is $single
EOF
cat <<\
"E O F"
this is $single
E O F
cat << \
"E O F"
this is $single
E O F

# 16
cat <<-\
"EOF"
this is $single
EOF
cat <<-\
"E O F"
this is $single
E O F
cat <<- \
"E O F"
this is $single
E O F

Felipe Contreras (8):
syntax: sh: fix unmatched syntax
syntax: sh: remove duplicate syntax
syntax: sh: fix heredoc match
syntax: sh: remove extra heredoc match
syntax: sh: fix quote style in heredoc
syntax: sh: add missing match
syntax: sh: fix heredoc with space delimiters
syntax: sh: reorganize heredocs

runtime/syntax/sh.vim | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)

--
2.22.0

Felipe Contreras

unread,
Jun 13, 2019, 6:13:18 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
This wasn't working correctly:

cat <<-\EOF
this is $single
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index b9c71de4c..a4704d61b 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -396,7 +396,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\s*\z1\s*$"

" Here Strings: {{{1
" =============
@@ -734,6 +734,7 @@ if !exists("skip_sh_syntax_inits")
hi def link shHereDoc13 shRedir
hi def link shHereDoc14 shRedir
hi def link shHereDoc15 shRedir
+ hi def link shHereDoc16 shRedir
endif

" Delete shell folding commands {{{1
--
2.22.0

Felipe Contreras

unread,
Jun 13, 2019, 6:13:19 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 --
1 file changed, 2 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index a4704d61b..384971344 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -396,7 +396,6 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\s*\z1\s*$"

" Here Strings: {{{1
" =============
@@ -734,7 +733,6 @@ if !exists("skip_sh_syntax_inits")
hi def link shHereDoc13 shRedir
hi def link shHereDoc14 shRedir
hi def link shHereDoc15 shRedir
- hi def link shHereDoc16 shRedir

Felipe Contreras

unread,
Jun 13, 2019, 6:13:22 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
shHereDoc14 is already catching the \ which makes the match functionally
different (not double quotes).

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 077024a36..16a36d30c 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -381,7 +381,7 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup

" Here Documents: {{{1
" =========================================
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
--
2.22.0

Felipe Contreras

unread,
Jun 13, 2019, 6:13:24 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
The spaces where missing, this wasn't working correctly:

cat << \EOF
this is $single
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 384971344..077024a36 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -394,7 +394,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"

" Here Strings: {{{1
--
2.22.0

Felipe Contreras

unread,
Jun 13, 2019, 6:13:24 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
This was using the wrong quote:

cat <<-\
EOF
this is $double
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 16a36d30c..67eb5f90b 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -390,7 +390,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
--
2.22.0

Felipe Contreras

unread,
Jun 13, 2019, 6:13:25 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
The unshifted version of shHereDoc11 is missing, so this fails:

cat <<\
\EOF
this is $single
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 ++
1 file changed, 2 insertions(+)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 67eb5f90b..11ec3c862 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -396,6 +396,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\z1\s*$"

" Here Strings: {{{1
" =============
@@ -733,6 +734,7 @@ if !exists("skip_sh_syntax_inits")
hi def link shHereDoc13 shRedir
hi def link shHereDoc14 shRedir
hi def link shHereDoc15 shRedir
+ hi def link shHereDoc16 shRedir

Felipe Contreras

unread,
Jun 13, 2019, 6:13:27 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
This works correctly for the shifted version, but not the unshifted:

cat <<\
'E O F'
this is $single
E O F

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 11ec3c862..cad40a545 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -388,8 +388,8 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
--
2.22.0

Felipe Contreras

unread,
Jun 13, 2019, 6:13:29 PM6/13/19
to vim...@googlegroups.com, Charles E . Campbell, Nikolay Pavlov, Felipe Contreras
So that it makes sense what we are trying to do.

No functional changes; just moving and renaming.

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index cad40a545..a5d645fc6 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -382,21 +382,21 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup
" Here Documents: {{{1
" =========================================
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\s*\z1\s*$" contains=@shDblQuoteList
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc09 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc13 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc15 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1\s*$"

" Here Strings: {{{1
" =============
--
2.22.0

Bram Moolenaar

unread,
Jun 14, 2019, 6:27:57 AM6/14/19
to vim...@googlegroups.com, Felipe Contreras, Charles E . Campbell, Nikolay Pavlov

[fixed the email address of Charles, you had NOSPAM still in there]

> This works correctly for the shifted version, but not the unshifted:
>
> cat <<\
> 'E O F'
> this is $single
> E O F

Normally I would say to talk directly to the maintainer. Unfortunately
I have not received a response from Charles for a while.

The shell syntax file is tricky and complex. If someone wants to take
over it has to be someone who is familiar with all the different shell
syntaxes. I'm not sure we can find someone who is willing to put in the
time to not only fix one bug, but actually maintain it.

--
hundred-and-one symptoms of being an internet addict:
170. You introduce your wife as "my_...@home.wife" and refer to your
children as "forked processes."

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Felipe Contreras

unread,
Jun 14, 2019, 2:55:20 PM6/14/19
to Bram Moolenaar, vim_dev, Charles E . Campbell, Nikolay Pavlov


On Fri, Jun 14, 2019, 05:27 Bram Moolenaar <Br...@moolenaar.net> wrote:

[fixed the email address of Charles, you had NOSPAM still in there]

> This works correctly for the shifted version, but not the unshifted:
>
>   cat <<\
>   'E O F'
>   this is $single
>   E O F

Normally I would say to talk directly to the maintainer.  Unfortunately
I have not received a response from Charles for a while.

Last time I set patches it took him two years to respond, and he did it only to the mailing list so I didn't receive anything.

It seems he never did anything with the patches and the fixes I sent were done anyway years later, but not correctly. It's hard to tell from the git log.

I'm not holding my breath.

The shell syntax file is tricky and complex.  If someone wants to take
over it has to be someone who is familiar with all the different shell
syntaxes.  I'm not sure we can find someone who is willing to put in the
time to not only fix one bug, but actually maintain it.

I'm an expert on sh, but I only know Vimscript superficially. I wouldn't have a problem taking maintenance of the syntax file temporarily, but I don't know how much load there is.

Anyway, regardless of that, what would be the fate of these patches? I think they are obviously correct, and anybody that analyses them for a bit could see that.

Cheers.
Reply all
Reply to author
Forward
0 new messages