logo       

Re: [edit+] heredoc syntax highlighting for PHP: msg#00001

editors.editplus.general

Subject: Re: [edit+] heredoc syntax highlighting for PHP


based on the php reference for heredoc:
http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

the heredoc syntax only requires the following:

echo <<<EOF
Hello!
EOF;

thanks to the following:

http://www.machak.com/editplus/viewtopic.php?t=33

i discovered you can take advantage of unused "block comment 2" to
accomplish this. add the following to your php.stx file:

#COMMENTON2=<<<EOF
#COMMENTOFF2=EOF;

realize this does not allow for variable heredoc identifiers. the php
script will validate them of course, but editplus will only highlight
using the identifier you put in your stx file (EOF above). alternatively
the following should work:

#COMMENTON2=<<<
#COMMENTOFF2=;

if you don't expect to include any semi-colons in your string.

i've added this solution to the faq i started last month:
http://www.unc.edu/~jwatt/2004/07/editplus-customizations-faq.html

Justin Watt


On Tue, 3 Aug 2004, Marc Leveille wrote:

> Does anyone know if you can define multiple values for
> #SCRIPT_BEGIN and #SCRIPT_END in the syntax files?
> I use Here Documents syntax a lot in my PHP scripts, and it
> screws up the syntax highlighting something awful.
>
> For example, assuming a regex is out of the question, I'd
> like to define #SCRIPT_END to "<<<" and #SCRIPT_BEGIN
> to "//>>>", or maybe also "EOF", so I can write:
>
> echo <<<EOF
> Hello!
> EOF;
> //>>>
>
> Now that I've gotten used to using proper syntax in my
> PHP files, EditPlus has been excellent in all other respects. :)
>
> -- Marc Leveille
>
>
>
>
> http://www.editplus.com
> http://groups.yahoo.com/group/editplus
> Yahoo! Groups Links
>
>
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/spZplB/TM
--------------------------------------------------------------------~->

http://www.editplus.com
http://groups.yahoo.com/group/editplus
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/editplus/

<*> To unsubscribe from this group, send an email to:
editplus-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise