Topic: Syntax highlight keywords without separators (1 of 4), Read 42 times
Conf: Program develop.,Color syntax
From: Pauli Lindgren
Date: Tuesday, June 13, 2006 10:55 AM

Hi,

I wonder if it would be possible to change the syntax highlight so that it could highlight keywords even if they are not surrounded by separator characters?

I was trying to highlight function calls in C source with the following in c.syn file:

Reserved2 = |A|E+|[|B](

This does highlight the function, if the parenthesis is followed by space or some other separator, e.g.
foo( bar );
foo(&bar);
but not
foo(bar);

If the requirement for separators can not be relaxed, then perhaps it would be possible to accept the '(' character as separator, while still including it in the matching pattern?

--
Pauli

 


Topic: Syntax highlight keywords without separators (2 of 4), Read 23 times
Conf: Program develop.,Color syntax
From: Pauli Lindgren
Date: Thursday, December 20, 2007 08:06 AM

On 6/13/2006 10:55:19 AM, Pauli Lindgren wrote:
>
>I was trying to highlight function calls in C source
>with the following in c.syn file:
>
> Reserved2 = |A|E+|[|B](
>
>This does highlight the function, if the parenthesis
>is followed by space or some other separator, e.g.
> foo( bar );
> foo(&bar);
>but not
> foo(bar);

I was able to highlight functions on C source by adding the pattern in Symbols section:
Symbols = + - * / % < > = & ^ || ~ ! ? : ( ) [ ] . "," |A|E+|[|B]( 

But of course this highlights functions with symbols color.
Could it be possible to add a new category in syntax file for functions? It would work like symbols, i.e. separator would not be required. And the color for it could be selected separately.

--
Pauli

 


Topic: Syntax highlight keywords without separators (3 of 4), Read 24 times
Conf: Program develop.,Color syntax
From: Ian Binnie
Date: Thursday, December 20, 2007 08:33 PM

On 12/20/2007 8:06:29 AM, Pauli Lindgren wrote:
>On 6/13/2006 10:55:19 AM, Pauli Lindgren
>wrote:
>>
>>I was trying to highlight function calls in C source
>>with the following in c.syn file:
>>
>> Reserved2 = |A|E+|[|B](
>>
>>This does highlight the function, if the parenthesis
>>is followed by space or some other separator, e.g.
>> foo( bar );
>> foo(&bar);
>>but not
>> foo(bar);
>
>I was able to highlight functions on C
>source by adding the pattern in Symbols
>section:
>Symbols = + - * / % < > = & ^ || ~ ! ? :
>( ) [ ] . "," |A|E+|[|B](
>But of course this highlights functions
>with symbols color.
>Could it be possible to add a new
>category in syntax file for functions?
>It would work like symbols, i.e.
>separator would not be required. And the
>color for it could be selected
>separately.
>
>--
>Pauli

I would welcome this.
It has been one of my (minor) frustrations of the limited categories in Vedit

 


Topic: Re: Syntax highlight keywords without separators (4 of 4), Read 21 times
Conf: Program develop.,Color syntax
From: Ted Green
Date: Friday, December 21, 2007 11:44 AM

At 08:07 AM 12/20/2007, you wrote:
>I was able to highlight functions on C source by adding the pattern in Symbols section:
>
Symbols = + - * / % < > = & ^ || ~ ! ? : ( ) [ ] . "," |A|E+|[|B]( 

>But of course this highlights functions with symbols color.
>Could it be possible to add a new category in syntax file for functions? It would work like symbols, i.e. separator would not be required. And the color for it could be selected separately.

I cannot fit this into the minor update I am working on now.

Ted.