Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Matching template brackets

(1/4) > >>

smallB:
I think that having matching template brackets highlighted would be quite nice (specially for metaprogramming tasks). Anyway, this would also make Code::Blocks behaving in more unified way:
Why do we highlight:
a) [ and ]
b) ( and )
but not < and >
?

oBFusCATed:
Because it is hard to do. e need a semantic highlighting, but we don't have it currently.

Think about this:

--- Code: ---if (a<b && b>c)
   ...

--- End code ---
This one should not be highlighted, but this:


--- Code: ---if (a<int>(5, 10)==5)
  ...

--- End code ---
should.

If can describe an algorithm, which works correctly for all the cases, then we can implement it.

smallB:
How about (for a start only):  
If 'a' is a template then:
1. '<' means start of template parameters,
2. If above applies, then next token must be a type or if a has integral type as a template param then this token must be of this type?
3. If 'a' isn't a template then '<' means less than.

oBFusCATed:

--- Quote from: smallB on October 24, 2011, 07:46:55 am ---How about (for a start only):  
If 'a' is a template then:

--- End quote ---
When we do brace matching, we don't know if a is template or not.
The brace matching is done in core, but knowing if a is template is done/stored in CC plugin.

smallB:
But surely there must be a way to get this info from CC or get this info in other way?

Navigation

[0] Message Index

[#] Next page

Go to full version