On Sun, 30 Jan 2011 14:22:49 +0100, Colomban wrote:
Le 30/01/2011 14:02, Enrico Tröger a écrit :
On Mon, 20 Dec 2010 23:44:26 +0100, Colomban wrote:
Still me...
In a close topic, I just found how to fix the suffix of anonymous strucs/enums symbols in C-style languages, patch attached.
Fix the suffix? What was wrong?
The number used as suffix for anonymous structures and unions. It currently always increase and is never reset to 0. It's not a real problem, but it the tag list get update in live-time, it grows very fast and easily reaches 1000, 5000 or worst -- only depends on the number of reparsing and anonymous enum/structs in the file.
Ah ok. Thanks for clarifying.
However, I wonder why it was like it was before, was there a reason? I mean, the variable (contextual_fake_count) pas properly initialized, but in initialize*Parser() (which is called only once per language). I feel weird about this being an accident... I see 3 possibilities:
- it was actually an accident, fixing it is good;
- the behavior of the tagmanager changed and initialise*Parser()
was used to be called before each parse, so fixing it is good; 3) it was intentional for some reasons, so "fixing" it is probably wrong.
As a possible reason for 3, I'd think that it was perhaps to avoid having two anonymous symbols with the same name in a workspace. But I don't see why it'd be a problem to have those "conflicts", since name clash is not an issue with the TM workspace...
What do you know/think?
Not sure. If I read the SVN log correctly, Nick committed it as backport of Anjuta code (svn diff -r1194:1195).
Right, thanks for finding the commit! :) However, it doesn't easily tell which of the 3 possibilities is the one, maybe initialize*Parser() used to be called before each and every parsing. Or maybe Anjuta uses a separate process for tag parsing, in which case it isn't a concern since it is automatically reset between parsings?
No idea, sorry. But I guess you tested your fix and didn't find any problems? If so, I think we should apply it.
Regards, Enrico