jed-users mailing list

[2009 Date Index] [2009 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

special syntax highlighting


I have a problem with syntax highlighting and the goto_match function.

My situation is a little bit complicated, I have to explain:

I do most of my programming with Perl and (of course) jed.
The regular syntax highlighting most of the time does a great job, it
really helps a lot in programming. 

But there is one situation when jed's syntax highlighting fails: 
HERE DOCUMENT strings.

They look like:

   print <<EOD;
here comes data: "blubb" $variable
   ... and some
   more lines
 until
EOD
  
everything between the EOD markers will get printed.
jed interprets these data as Perl source, which is wrong. It is a (long)
string. Next problem is that code line idention is broken. Mixing Perl and
HTML code in this way is a pain in *CENSORED* :-)

To overcome these problems I have written a Perl function pq() which
allows the following syntax:

   pq(qq(
     'here comes data: "blubb" $variable
     '   ... and some
     '   more lines
     ' until
   ));

On Perl level it produces exactly the same output as the HERE DOCUMENT
variant above. The leading ' is used by the pq function to mark the
beginning of the output line, so that indention spaces can be ignored. 
Second, these ' characters help jed to colorize the rest of the line as
string. 

So far, I was quite happy with my solution. Until I tried the jed function
goto_match (finding corresponding braces), I got: "Run-Time Error"

Probably the ' characters are the problems.
I then changed the them to »

goto_match now works again, but syntax highlighting does not work, because
jed does not detect these lines as string.

How can I tell jed to recognize » as a string delimiter?


I am also open to other suggestions.


-- 
Ullrich Horlacher              Server- und Arbeitsplatzsysteme
Rechenzentrum                  E-Mail: horlacher@xxxxxxxxxxxxxxxxxxxx
Universitaet Stuttgart         Tel:    ++49-711-685-65868
Allmandring 30                 Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2009 date index] [2009 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]