Re: Bug in gtksourceview's handling of #if 0



Hi Michael,

On Sun, 2003-05-11 at 16:35, Michael Terry wrote:
> Hello.  I was playing around with gtksourceview, and noticed that the 
> c.lang file has the cool feature of treating #if 0's as block comments. 
>   However, it is a little broken, and may have to be taken out? (Unless 
> there is a sexy regexp way to fix it...)
> 
> It stops coloring at the first #endif, instead of a matching #endif. 
> Thus, if you have
> 
> #if 0
> #if 1
> #endif
> #endif
> 
> it will only color to the first #endif.

That's right, it doesn't work as expected in that case.  Unfortunately
there's no possible solution using regular expressions and the current
highlighting engine.  We need a stack based engine for that to work
correctly because the nesting depth is arbitrary.  Redesigning the
engine this way is on the TODO list, but it will not happen in the near
future.  Maybe for Gnome 2.6... who knows :-)

I'm not sure about removing the pattern from c.lang though.  It's nice
ting to have when it works.  Paolo, what do you think?

Greetings,
Gustavo

> 
> -mt




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]