Compound quotes and recursive features in syntax files

Discuss syntax highlighting or submit new syntax files.
Post Reply
Creativus
Posts: 1
Joined: 02 Dec 2008 04:38

Compound quotes and recursive features in syntax files

Post by Creativus »

Hello All!

I am preparing a syntax highlighter, and have some questions, perhaps someone could help me with them:

1. Compound quotes are used to enclose text like so: `"alpha beta gamma"'. Note that the opening quote is different from the closing quote. Standard string character is same for opening and closing and it is a single character. What is the best way of defining highlighting for strings with compound quotes like above? I have declared them as a block so far, but wanted to see if other options are available.

2. Recursive features are of the kind: `"alpha `"beta gamma"' delta"'. Once I define highlighting with `" as the start of a block and "' as the end, alpha, beta and gamma become the part of the block, but delta - no, though it is supposed to be. Similarly with comments, e.g.:

Code: Select all

command1
/* this is a comment
   /* and this is a comment */
  --->this is still a comment !!! <---
*/
command2
How do I explicitly state that the block definition is recursive? Similarly to the {} brackets?

3. How do I specify that a particular word is highlighted differently depending on whether it is the first word in the line? E.g.

Code: Select all

  if (`alpha'>0) replace var1=`alpha' if (`beta'<0)
Here the first if is the keyword, while the second is a modifier of the replace command and I'd like to highlight it differently. A related issue is that character * (star) is a marker for begin of the commentary if it is the first non-whitespace character in the command line.

So far I could not make any other syntax highlighting editor correctly deal with these and a couple of other more involved situations. But I hope the local Gurus might have some suggestions.

Thank you,
Sergiy Radyakin
Post Reply