NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Syntax coloring when <<< used


Joined: 01 Aug 2003
Posts: 13
Reply with quote
Hello, when using phped 3.3eval and I define a variable like:

$data=<<<EOD
<?xml version="1.0" encoding="Windows-1252"?>
EOD;

the quotes breaks the syntax highlighting so all php below it geats greyed out.
View user's profileFind all posts by cyppeSend private message


Joined: 01 Aug 2003
Posts: 13
Reply with quote
oh, and it's not only the quotes itself, but the ?> inside there i realised.. but still same thing.
View user's profileFind all posts by cyppeSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
it's <<< operator that is really hard to support in state-less highlighter.
you may retype your code as follows:

Code:
$data="<?xml version=\"1.0\" encoding=\"Windows-1252\"?>";


BTW, do you know any php-oriented editor that supports <<< ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 01 Aug 2003
Posts: 13
Reply with quote
Hi, well.

One of the main reasons i use <<< operator is to -not-have-to- escape thoose chars. But I understand the editor problem.

Cant think of any editor that does it, but again. Haven't used so many.

But the php (.phps) extension highlights it correct. If it's any help.

Thanks for a great editor!
View user's profileFind all posts by cyppeSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
I know. PHP engine highlights correct, but it can't re-run highlighting from a given line and therefore it can't operate as an embedded highliter for an editor.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 01 Aug 2003
Posts: 13
Reply with quote
Would it not at least be possible to make it a dead zone between a <<<STARTTAG

-- dead zone, just greyed out --
--- until---

STARTTAG;

So everything below it could still be highlighted. Or something like that.
View user's profileFind all posts by cyppeSend private message


Joined: 01 Aug 2003
Posts: 13
Reply with quote
Hello, found out that VIM handles this <<< syntax coloring thing.

Using the syntax coloring map : , it also matches the START/END pairs, like


$var <<< UNTILEND
Stuff, stuff... <?php ?> ... no problem, all just text......
UNTILEND;

then both UNTILEND is highlighted also, and everything below it, so it doesnt break the highlight.
View user's profileFind all posts by cyppeSend private message


Joined: 17 May 2004
Posts: 5
Reply with quote
A workaround that I use is:
Code:

$a = <<< EOF
<!--/*-->
<?xml version="1.0" encoding="Windows-1252"?>
<!--*/-->
EOF;


This will highlight the HTML code as one big comment.
View user's profileFind all posts by philip99Send private message


Joined: 06 Oct 2003
Posts: 13
Reply with quote
I remember that macromedia homesite, whch i used to use (version 5.5 i believe) highlighted heredoc syntax perfectly: as if it were a string. come to think of it, I'm pretty sure it had a specific highlight-color option for heredoc strings that was separate from the color for regular strings.

that would be a nice feature in phpEd.
View user's profileFind all posts by nebySend private message
Syntax coloring when <<< used
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic