The current syntax highlighting of Perl heredocs[0] (and similar
constructs in other languages) has a known limitation of highlighting
anything after the heredoc start (e.g., "<<EOF") and on the same line as
a string instead of using normal highlighting.

 [0] - syn region perlHereDoc matchgroup=perlStringStartEnd 
start=+<<\z(\I\i*\)+ end=+^\z1$+ [EMAIL PROTECTED]

After some fiddling around with the syntax highlighting[1], I've been
able to get that text to be highlighted normally instead.

 [1] - syn region perlHereDoc matchgroup=perlStringStartEnd 
start=+\%(<<\z(\I\i*\).*\n\)\@<=+ end=+^\z1$+ [EMAIL PROTECTED]
       syn match perlStringStartEnd +<<\I\i*+ nextgroup=perlHereDoc

The only problem with this is that the perlHereDoc region is trying to
match +^$+ (a blank line) as its end pattern instead of a line
containing simply the heredoc token.  It seems that since the \z(\) is
inside the lookbehind, the external match isn't being saved.

Could Vim's regex handling be changed to save the external match even
though it's being matched in a zero-width atom?

This snippet of Perl code can be used to check the syntax highlighting.

 print <<END and print "bar\n";
 foo
 END
 $foo = "bar\n";

Currently, everything between "<<END" and "END" is highlighted as a string.
With the above changes "<<END" and all the lines after the print
statement are highlighted as a string.  Adding a blank line after the
"END" line will cause the final line to be properly highlighted.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui