PHP heredoc

Discuss syntax highlighting or submit new syntax files.
Post Reply
User avatar
kaaposc
Posts: 4
Joined: 28 Feb 2008 12:03

PHP heredoc

Post by kaaposc »

Hi!

It seems PHP heredoc strings are not treated as strings... Or am I mistaken with syntax coloring/syntax definitions?.. :roll:
-- kaaposc
"The Knowledge is Power"
User avatar
Rickard Johansson
Site Admin
Posts: 6627
Joined: 19 Jul 2006 14:29

Post by Rickard Johansson »

No, you are right. The syntax doesn't handle these strings properly. It is possible to handle them if yoy use a fixed identifier.

E.g.

Put this in the php.syx (I asume you use v4.20 beta 1)

[Block]
...
3_Name=HereDoc string
3_OnLine=No
3_AsString=Yes
3_Start<<<ID
3_End=ID

Now you should be able to use

... <<<ID

comments

ID;

Maybe not a perfect solution. I'll add a better one when I get the time. I need to add some new options to make it work properly.
User avatar
kaaposc
Posts: 4
Joined: 28 Feb 2008 12:03

Post by kaaposc »

Thanks, I tried something like that, but with AsString=No because heredoc can contain PHP variables (so it would be nice to see them colored as variables).. :)
-- kaaposc
"The Knowledge is Power"
Post Reply