[geany/geany] 9642f1: Merge pull request #3059 from techee/anon4

Thomas Martitz git-noreply at xxxxx
Sat Feb 12 21:38:16 UTC 2022


Branch:      refs/heads/master
Author:      Thomas Martitz <thomas.martitz at mailbox.org>
Committer:   GitHub <noreply at github.com>
Date:        Sat, 12 Feb 2022 21:38:16 UTC
Commit:      9642f17d83ce8d2e4e8d3e08c3cfd589f98741d8
             https://github.com/geany/geany/commit/9642f17d83ce8d2e4e8d3e08c3cfd589f98741d8

Log Message:
-----------
Merge pull request #3059 from techee/anon4

There are several problems with how we handle anonymous tags which this pull request tries to resolve:

1. Anonymous tags are currently determined based on how these tags are named by ctags which may not be completely reliable and unnecessary. ctags now has XTAG_ANONYMOUS flag we can query and determine whether a tag is anonymous or not based on that. Our fortran parser didn't report XTAG_ANONYMOUS so it has been updated to do so.
2. In order to store the information about anonymous tags, this pull request renames the unused `pointerOrder` member of TMTag (see the corresponding commit about more details  to `flags` and uses one bit to indicate whether a tag is anonymous. This is technically a API change but since pointerOrder always contained 0 and was unused (or maybe used by some super-old parser 15 years back), it doesn't really matter (no g-p plugin uses this field).
3. With the introduction of the new cxx parser, anonymous tags are reported as `__anonNUM` - before they were reported as e.g `anon_struct_NUM` - i.e. they contained information about the type in their name which made them easier to identify in the symbol tree. This pull request adds back this naming.
4. In addition to (3), the NUM in the previous parser was global for all types - i.e. tags were named as `anon_enum_1`, `anon_struct_2`, `anon_enum_3` which is a bit strange as it suggests there are 3 enums but there are 2 instead. This pull request makes these numbers per-type so the above becomes `anon_enum_1`, `anon_struct_1`, `anon_enum_2`.
5. This pull request sets the name of anonymous tag if it's followed by the corresponding typedef tag and the typedef tag is removed. For instance, for `typedef struct{int a} Foo;` you would previously get an anonymous tag for the struct under which `a` would be shown and then separately tag `Foo` as a typedef. After this patch, you get a tag `Foo` for the struct with `a` as its member and the anonymous name is dropped which makes things much clearer in the sidebar.

And finally, thanks to the fact that we do renaming of anonymous tags ourselves now, the last diff against ctags main can be dropped so we can use the upstream version without any modifications and the patch file isn't necessary any more. Hurray!!!


Modified Paths:
--------------
    ctags/ctags_changes.patch
    ctags/main/parse.c
    ctags/parsers/geany_fortran.c
    scripts/update-ctags.py
    src/plugindata.h
    src/tagmanager/tm_ctags.c
    src/tagmanager/tm_parser.c
    src/tagmanager/tm_parser.h
    src/tagmanager/tm_source_file.c
    src/tagmanager/tm_tag.c
    src/tagmanager/tm_tag.h
    tests/ctags/bit_field.c.tags
    tests/ctags/bug1466117.c.tags
    tests/ctags/bug1491666.c.tags
    tests/ctags/bug556646.c.tags
    tests/ctags/bug639639.h.tags
    tests/ctags/bug639644.hpp.tags
    tests/ctags/complex-return.js.tags
    tests/ctags/enum.f90.tags
    tests/ctags/enumerators.f90.tags
    tests/ctags/interfaces.f90.tags
    tests/ctags/namespace.cpp.tags
    tests/ctags/numlib.f90.tags
    tests/ctags/process_order.c.tags
    tests/ctags/recursive.f95.tags
    tests/ctags/structure.f.tags

Modified: ctags/ctags_changes.patch
24 lines changed, 0 insertions(+), 24 deletions(-)
===================================================================
@@ -1,24 +0,0 @@
-A patch to ctags containing our changes to ctags
-(changing anon tag names from anon<hash> to anon<number>).
-diff --git a/ctags/main/parse.c b/ctags/main/parse.c
-index 8fbb7148..c12f8662 100644
---- ctags/main/parse.c
-+++ ctags/main/parse.c
-@@ -4111,12 +4111,18 @@ extern void anonGenerate (vString *buffer, const char *prefix, int kind)
- 	parser -> anonymousIdentiferId ++;
- 
- 	char szNum[32];
-+#if 0
- 	char buf [9];
- 
- 	vStringCopyS(buffer, prefix);
- 
- 	anonHashString (getInputFileName(), buf);
- 	sprintf(szNum,"%s%02x%02x",buf,parser -> anonymousIdentiferId, kind);
-+#else
-+	/* we want to see numbers for anon functions in the tree view instead of the hash */
-+	vStringCopyS(buffer, prefix);
-+	sprintf(szNum,"%u", parser -> anonymousIdentiferId);
-+#endif
- 	vStringCatS(buffer,szNum);
- }


Modified: ctags/main/parse.c
6 lines changed, 0 insertions(+), 6 deletions(-)
===================================================================
@@ -4787,18 +4787,12 @@ extern void anonGenerate (vString *buffer, const char *prefix, int kind)
 	parser -> anonymousIdentiferId ++;
 
 	char szNum[32];
-#if 0
 	char buf [9];
 
 	vStringCopyS(buffer, prefix);
 
 	anonHashString (getInputFileName(), buf);
 	sprintf(szNum,"%s%02x%02x",buf,parser -> anonymousIdentiferId, kind);
-#else
-	/* we want to see numbers for anon functions in the tree view instead of the hash */
-	vStringCopyS(buffer, prefix);
-	sprintf(szNum,"%u", parser -> anonymousIdentiferId);
-#endif
 	vStringCatS(buffer,szNum);
 }
 


Modified: ctags/parsers/geany_fortran.c
6 lines changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -190,6 +190,7 @@ typedef struct sTokenInfo {
 	struct sTokenInfo *secondary;
 	unsigned long lineNumber;
 	MIOPos filePosition;
+	bool anonymous;
 } tokenInfo;
 
 /*
@@ -430,6 +431,7 @@ static tokenInfo *newToken (void)
 	token->secondary    = NULL;
 	token->lineNumber   = getInputLineNumber ();
 	token->filePosition = getInputFilePosition ();
+	token->anonymous    = false;
 
 	return token;
 }
@@ -447,6 +449,7 @@ static tokenInfo *newAnonTokenFrom (tokenInfo *const token, const char *type)
 {
 	char buffer[64];
 	tokenInfo *result = newTokenFrom (token);
+	result->anonymous = true;
 	sprintf (buffer, "%s#%u", type, contextual_fake_count++);
 	vStringClear (result->string);
 	vStringCatS (result->string, buffer);
@@ -492,6 +495,9 @@ static void makeFortranTag (tokenInfo *const token, tagType tag)
 		if (token->tag == TAG_COMMON_BLOCK)
 			e.lineNumberEntry = canUseLineNumberAsLocator();
 
+		if (token->anonymous)
+			markTagExtraBit (&e, XTAG_ANONYMOUS);
+
 		e.lineNumber	= token->lineNumber;
 		e.filePosition	= token->filePosition;
 		e.isFileScope	= isFileScope (token->tag);


Modified: scripts/update-ctags.py
3 lines changed, 0 insertions(+), 3 deletions(-)
===================================================================
@@ -51,6 +51,3 @@
 main_diff = set(main_src_files) - set(main_dst_files)
 if main_diff:
     print('Files added to main: ' + str(main_diff))
-
-os.chdir(dstdir)
-os.system('patch -p1 <ctags_changes.patch')


Modified: src/plugindata.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -58,7 +58,7 @@ G_BEGIN_DECLS
  * @warning You should not test for values below 200 as previously
  * @c GEANY_API_VERSION was defined as an enum value, not a macro.
  */
-#define GEANY_API_VERSION 242
+#define GEANY_API_VERSION 243
 
 /* hack to have a different ABI when built with different GTK major versions
  * because loading plugins linked to a different one leads to crashes.


Modified: src/tagmanager/tm_ctags.c
145 lines changed, 144 insertions(+), 1 deletions(-)
===================================================================
@@ -120,7 +120,10 @@ static gboolean init_tag(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag
 	tag->name = g_strdup(tag_entry->name);
 	tag->type = type;
 	tag->local = tag_entry->isFileScope;
-	tag->pointerOrder = 0;	/* backward compatibility (use var_type instead) */
+	tag->flags = tm_tag_flag_none_t;
+	if (isTagExtraBitMarked(tag_entry, XTAG_ANONYMOUS))
+		tag->flags |= tm_tag_flag_anon_t;
+	tag->kind_letter = kind_letter;
 	tag->line = tag_entry->lineNumber;
 	if (NULL != tag_entry->extensionFields.signature)
 		tag->arglist = g_strdup(tag_entry->extensionFields.signature);
@@ -238,12 +241,152 @@ void tm_ctags_clear_ignore_symbols(void)
 }
 
 
+/* call after all tags have been collected so we don't have to handle reparses
+ * with the counter (which gets complicated when also subparsers are involved) */
+static void rename_anon_tags(TMSourceFile *source_file)
+{
+	gint *anon_counter_table = NULL;
+	GPtrArray *removed_typedefs = NULL;
+	guint i;
+
+	for (i = 0; i < source_file->tags_array->len; i++)
+	{
+		TMTag *tag = TM_TAG(source_file->tags_array->pdata[i]);
+		if (tm_tag_is_anon(tag))
+		{
+			gchar *orig_name, *new_name = NULL;
+			guint j;
+			guint new_name_len, orig_name_len;
+			guint scope_len = tag->scope ? strlen(tag->scope) : 0;
+			gchar kind = tag->kind_letter;
+
+			orig_name = tag->name;
+			orig_name_len = strlen(orig_name);
+
+			if (source_file->lang == TM_PARSER_C || source_file->lang == TM_PARSER_CPP)
+			{
+				/* First check if there's a typedef behind the scope nesting
+				 * such as typedef struct {} Foo; - in this case we can replace
+				 * the anon tag with Foo */
+				for (j = i + 1; j < source_file->tags_array->len; j++)
+				{
+					TMTag *nested_tag = TM_TAG(source_file->tags_array->pdata[j]);
+					guint nested_scope_len = nested_tag->scope ? strlen(nested_tag->scope) : 0;
+
+					/* Nested tags have longer scope than the parent - once the scope
+					 * is equal or lower than the parent scope, we are outside the tag's
+					 * scope. */
+					if (nested_scope_len <= scope_len)
+						break;
+				}
+
+				/* We are out of the nesting - the next tag could be a typedef */
+				if (j < source_file->tags_array->len)
+				{
+					TMTag *typedef_tag = TM_TAG(source_file->tags_array->pdata[j]);
+					guint typedef_scope_len = typedef_tag->scope ? strlen(typedef_tag->scope) : 0;
+
+					/* Should be at the same scope level as the anon tag */
+					if (typedef_tag->type == tm_tag_typedef_t &&
+						typedef_scope_len == scope_len &&
+						g_strcmp0(typedef_tag->var_type, tag->name) == 0)
+					{
+						/* set the name of the original anon tag and pretend
+						 * it wasn't a anon tag */
+						tag->name = g_strdup(typedef_tag->name);
+						tag->flags &= ~tm_tag_flag_anon_t;
+						new_name = tag->name;
+						/* the typedef tag will be removed */
+						if (!removed_typedefs)
+							removed_typedefs = g_ptr_array_new();
+						g_ptr_array_add(removed_typedefs, GUINT_TO_POINTER(j));
+					}
+				}
+			}
+
+			/* there's no typedef name for the anon tag so let's generate one  */
+			if (!new_name)
+			{
+				gchar buf[50];
+				guint anon_counter;
+				const gchar *kind_name = tm_ctags_get_kind_name(kind, tag->lang);
+
+				if (!anon_counter_table)
+					anon_counter_table = g_new0(gint, 256);
+
+				anon_counter = ++anon_counter_table[kind];
+
+				sprintf(buf, "anon_%s_%u", kind_name, anon_counter);
+				tag->name = g_strdup(buf);
+				new_name = tag->name;
+			}
+
+			new_name_len = strlen(new_name);
+
+			/* Check if this tag is parent of some other tag - if so, we have to
+			 * update the scope. It can only be parent of the following tags
+			 * so start with the next tag. */
+			for (j = i + 1; j < source_file->tags_array->len; j++)
+			{
+				TMTag *nested_tag = TM_TAG(source_file->tags_array->pdata[j]);
+				guint nested_scope_len = nested_tag->scope ? strlen(nested_tag->scope) : 0;
+				gchar *pos;
+
+				/* Terminate if outside of tag scope, see above */
+				if (nested_scope_len <= scope_len)
+					break;
+
+				pos = strstr(nested_tag->scope, orig_name);
+				/* We found the parent name in the nested tag scope - replace it
+				 * with the new name. Note: anonymous tag names generated by
+				 * ctags are unique enough that we don't have to check for
+				 * scope separators here. */
+				if (pos)
+				{
+					gchar *str = g_malloc(nested_scope_len + 50);
+					guint prefix_len = pos - nested_tag->scope;
+
+					strncpy(str, nested_tag->scope, prefix_len);
+					strcpy(str + prefix_len, new_name);
+					strcpy(str + prefix_len + new_name_len, pos + orig_name_len);
+					g_free(nested_tag->scope);
+					nested_tag->scope = str;
+				}
+			}
+
+			g_free(orig_name);
+		}
+	}
+
+	if (removed_typedefs)
+	{
+		for (i = 0; i < removed_typedefs->len; i++)
+		{
+			guint j = GPOINTER_TO_UINT(removed_typedefs->pdata[i]);
+			TMTag *tag = TM_TAG(source_file->tags_array->pdata[j]);
+			tm_tag_unref(tag);
+			source_file->tags_array->pdata[j] = NULL;
+		}
+
+		/* remove NULL entries from the array */
+		tm_tags_prune(source_file->tags_array);
+
+		g_ptr_array_free(removed_typedefs, TRUE);
+	}
+
+	if (anon_counter_table)
+		g_free(anon_counter_table);
+}
+
+
 void tm_ctags_parse(guchar *buffer, gsize buffer_size,
 	const gchar *file_name, TMParserType language, TMSourceFile *source_file)
 {
 	g_return_if_fail(buffer != NULL || file_name != NULL);
 
 	parseRawBuffer(file_name, buffer, buffer_size, language, source_file);
+
+	rename_anon_tags(source_file);
 }
 
 


Modified: src/tagmanager/tm_parser.c
21 lines changed, 21 insertions(+), 0 deletions(-)
===================================================================
@@ -874,6 +874,27 @@ const gchar *tm_parser_get_constructor_method(TMParserType lang)
 }
 
 
+/* determine anonymous tags from tag names only when corresponding
+ * ctags information is not available */
+gboolean tm_parser_is_anon_name(TMParserType lang, gchar *name)
+{
+	guint i;
+	char dummy;
+
+	if (sscanf(name, "__anon%u%c", &i, &dummy) == 1)  /* uctags tags files */
+		return TRUE;
+	else if (lang == TM_PARSER_C || lang == TM_PARSER_CPP)  /* legacy Geany tags files */
+		return sscanf(name, "anon_%*[a-z]_%u%c", &i, &dummy) == 1;
+	else if (lang == TM_PARSER_FORTRAN || lang == TM_PARSER_F77)  /* legacy Geany tags files */
+	{
+		return sscanf(name, "Structure#%u%c", &i, &dummy) == 1 ||
+			sscanf(name, "Interface#%u%c", &i, &dummy) == 1 ||
+			sscanf(name, "Enum#%u%c", &i, &dummy) == 1;
+	}
+	return FALSE;
+}
+
+
 static gchar *replace_string_if_present(gchar *haystack, gchar *needle, gchar *subst)
 {
 	if (strstr(haystack, needle))


Modified: src/tagmanager/tm_parser.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -129,6 +129,8 @@ gint tm_parser_scope_autocomplete_suffix(TMParserType lang, const gchar *str);
 
 const gchar *tm_parser_get_constructor_method(TMParserType lang);
 
+gboolean tm_parser_is_anon_name(TMParserType lang, gchar *name);
+
 gchar *tm_parser_update_scope(TMParserType lang, gchar *scope);
 
 gboolean tm_parser_enable_role(TMParserType lang, gchar kind);


Modified: src/tagmanager/tm_source_file.c
28 lines changed, 18 insertions(+), 10 deletions(-)
===================================================================
@@ -65,7 +65,7 @@ enum
 	TA_IMPL,
 	TA_LANG,
 	TA_INACTIVE, /* Obsolete */
-	TA_POINTER
+	TA_FLAGS
 };
 
 
@@ -175,7 +175,7 @@ gchar tm_source_file_get_tag_access(const gchar *access)
  @param fp FILE pointer from where the tag line is read
  @return TRUE on success, FALSE on FAILURE
 */
-static gboolean init_tag_from_file(TMTag *tag, TMSourceFile *file, FILE *fp)
+static gboolean init_tag_from_file(TMTag *tag, TMSourceFile *file, FILE *fp, TMParserType lang)
 {
 	guchar buf[BUFSIZ];
 	guchar *start, *end;
@@ -198,7 +198,11 @@ static gboolean init_tag_from_file(TMTag *tag, TMSourceFile *file, FILE *fp)
 			if (!isprint(*start))
 				return FALSE;
 			else
+			{
 				tag->name = g_strdup((gchar*)start);
+				if (tm_parser_is_anon_name(lang, tag->name))
+					tag->flags |= tm_tag_flag_anon_t;
+			}
 		}
 		else
 		{
@@ -219,8 +223,8 @@ static gboolean init_tag_from_file(TMTag *tag, TMSourceFile *file, FILE *fp)
 				case TA_SCOPE:
 					tag->scope = g_strdup((gchar*)start + 1);
 					break;
-				case TA_POINTER:
-					tag->pointerOrder = atoi((gchar*)start + 1);
+				case TA_FLAGS:
+					tag->flags |= atoi((gchar*)start + 1);
 					break;
 				case TA_VARTYPE:
 					tag->var_type = g_strdup((gchar*)start + 1);
@@ -324,6 +328,9 @@ static gboolean init_tag_from_file_ctags(TMTag *tag, TMSourceFile *file, FILE *f
 	tag->name = g_strndup(p, (gsize)(tab - p));
 	p = tab + 1;
 
+	if (tm_parser_is_anon_name(lang, tag->name))
+		tag->flags |= tm_tag_flag_anon_t;
+
 	/* tagfile, unused */
 	if (! (tab = strchr(p, '\t')))
 	{
@@ -376,9 +383,10 @@ static gboolean init_tag_from_file_ctags(TMTag *tag, TMSourceFile *file, FILE *f
 				const gchar *kind = value ? value : key;
 
 				if (kind[0] && kind[1])
-					tag->type = tm_parser_get_tag_type(tm_ctags_get_kind_from_name(kind, lang), lang);
+					tag->kind_letter = tm_ctags_get_kind_from_name(kind, lang);
 				else
-					tag->type = tm_parser_get_tag_type(*kind, lang);
+					tag->kind_letter = *kind;
+				tag->type = tm_parser_get_tag_type(tag->kind_letter, lang);
 			}
 			else if (0 == strcmp(key, "inherits")) /* comma-separated list of classes this class inherits from */
 			{
@@ -422,7 +430,7 @@ static TMTag *new_tag_from_tags_file(TMSourceFile *file, FILE *fp, TMParserType
 	switch (format)
 	{
 		case TM_FILE_FORMAT_TAGMANAGER:
-			result = init_tag_from_file(tag, file, fp);
+			result = init_tag_from_file(tag, file, fp, mode);
 			break;
 		case TM_FILE_FORMAT_PIPE:
 			result = init_tag_from_file_alt(tag, file, fp);
@@ -463,8 +471,8 @@ static gboolean write_tag(TMTag *tag, FILE *fp, TMTagAttrType attrs)
 		fprintf(fp, "%c%s", TA_SCOPE, tag->scope);
 	if ((attrs & tm_tag_attr_inheritance_t) && (NULL != tag->inheritance))
 		fprintf(fp, "%c%s", TA_INHERITS, tag->inheritance);
-	if (attrs & tm_tag_attr_pointer_t)
-		fprintf(fp, "%c%d", TA_POINTER, tag->pointerOrder);
+	if (attrs & tm_tag_attr_flags_t)
+		fprintf(fp, "%c%d", TA_FLAGS, tag->flags);
 	if ((attrs & tm_tag_attr_vartype_t) && (NULL != tag->var_type))
 		fprintf(fp, "%c%s", TA_VARTYPE, tag->var_type);
 	if ((attrs & tm_tag_attr_access_t) && (TAG_ACCESS_UNKNOWN != tag->access))
@@ -551,7 +559,7 @@ gboolean tm_source_file_write_tags_file(const gchar *tags_file, GPtrArray *tags_
 
 		ret = write_tag(tag, fp, tm_tag_attr_type_t
 		  | tm_tag_attr_scope_t | tm_tag_attr_arglist_t | tm_tag_attr_vartype_t
-		  | tm_tag_attr_pointer_t);
+		  | tm_tag_attr_flags_t);
 
 		if (!ret)
 			break;


Modified: src/tagmanager/tm_tag.c
14 lines changed, 3 insertions(+), 11 deletions(-)
===================================================================
@@ -228,7 +228,7 @@ gboolean tm_tags_equal(const TMTag *a, const TMTag *b)
 			strcmp(FALLBACK(a->name, ""), FALLBACK(b->name, "")) == 0 &&
 			a->type == b->type &&
 			a->local == b->local &&
-			a->pointerOrder == b->pointerOrder &&
+			a->flags == b->flags &&
 			a->access == b->access &&
 			a->impl == b->impl &&
 			a->lang == b->lang &&
@@ -665,18 +665,10 @@ tm_get_current_tag (GPtrArray * file_tags, const gulong line, const TMTagType ta
 	return matching_tag;
 }
 
+
 gboolean tm_tag_is_anon(const TMTag *tag)
 {
-	guint i;
-	char dummy;
-
-	if (tag->lang == TM_PARSER_C || tag->lang == TM_PARSER_CPP)
-		return sscanf(tag->name, "__anon%u%c", &i, &dummy) == 1;
-	else if (tag->lang == TM_PARSER_FORTRAN || tag->lang == TM_PARSER_F77)
-		return sscanf(tag->name, "Structure#%u%c", &i, &dummy) == 1 ||
-			sscanf(tag->name, "Interface#%u%c", &i, &dummy) == 1 ||
-			sscanf(tag->name, "Enum#%u%c", &i, &dummy) == 1;
-	return FALSE;
+	return tag->flags & tm_tag_flag_anon_t;
 }
 
 


Modified: src/tagmanager/tm_tag.h
12 lines changed, 10 insertions(+), 2 deletions(-)
===================================================================
@@ -65,7 +65,7 @@ typedef enum
 	tm_tag_attr_impl_t = 4096, /**< Implementation (e.g. virtual) */
 	tm_tag_attr_lang_t = 8192, /**< Language (File tag only) */
 	tm_tag_attr_inactive_t = 16384, /**< Inactive file (File tag only, obsolete) */
-	tm_tag_attr_pointer_t = 32768, /**< Pointer type */
+	tm_tag_attr_flags_t = 32768, /**< Additional flags */
 	tm_tag_attr_max_t = 65535 /**< Maximum value */
 } TMTagAttrType;
 
@@ -81,6 +81,13 @@ typedef enum
 #define TAG_IMPL_VIRTUAL 'v' /**< Virtual implementation */
 #define TAG_IMPL_UNKNOWN 'x' /**< Unknown implementation */
 
+enum
+{
+	tm_tag_flag_none_t = 0, /**< No flags */
+	tm_tag_flag_anon_t = 1, /**< Anonymous tag */
+	tm_tag_flag_max_t = 1, /**< Maximum value */
+};
+
 /**
  * The TMTag structure represents a single tag in the tag manager.
  **/
@@ -94,14 +101,15 @@ typedef struct TMTag
 	TMSourceFile *file; /**< File in which the tag occurs; NULL for global tags */
 	gulong line; /**< Line number of the tag */
 	gboolean local; /**< Is the tag of local scope */
-	guint pointerOrder;
+	guint flags; /**< Additional flags */
 	char *arglist; /**< Argument list (functions/prototypes/macros) */
 	char *scope; /**< Scope of tag */
 	char *inheritance; /**< Parent classes */
 	char *var_type; /**< Variable type (maps to struct for typedefs) */
 	char access; /**< Access type (public/protected/private/etc.) */
 	char impl; /**< Implementation (e.g. virtual) */
 	TMParserType lang; /* Programming language of the file */
+	gchar kind_letter; /* Kind letter from ctags */
 } TMTag;
 
 /* The GType for a TMTag */


Modified: tests/ctags/bit_field.c.tags
32 lines changed, 15 insertions(+), 17 deletions(-)
===================================================================
@@ -1,26 +1,24 @@
 # format=tagmanager
-__anon1�2048�0
-__anon2�2048�0
-__anon3�2048�0
 a�64�bit_fields�0�unsigned int:1
+anon_struct_1�2048�1
 b�64�bit_fields�0�unsigned int:1
-bad2�64�__anon2�0�BYTE:1
+bad2�64�bitfield_flags�0�BYTE:1
 bit_fields�2048�0
-bitfield_flags�4096�0�__anon2
+bitfield_flags�2048�0
 c�64�bit_fields�0�unsigned int:2
-exp�64�__anon1�0�unsigned
-frac0�64�__anon1�0�unsigned
-frac1�64�__anon1�0�unsigned
-group�64�__anon2�0�BYTE:1
+exp�64�anon_struct_1�0�unsigned
+frac0�64�anon_struct_1�0�unsigned
+frac1�64�anon_struct_1�0�unsigned
+group�64�bitfield_flags�0�BYTE:1
 lower�64�shortname_info�0�unsigned char:1
-mystruct�4096�0�__anon3
-personal�64�__anon2�0�BYTE:1
-private�64�__anon3�0�BYTE
-public�64�__anon2�0�BYTE:1
-public�64�__anon3�0�BYTE
+mystruct�2048�0
+personal�64�bitfield_flags�0�BYTE:1
+private�64�mystruct�0�BYTE
+public�64�bitfield_flags�0�BYTE:1
+public�64�mystruct�0�BYTE
 shortname_info�2048�0
-sign�64�__anon1�0�unsigned:1
-that�64�__anon3�0�BYTE
-this�64�__anon3�0�BYTE
+sign�64�anon_struct_1�0�unsigned:1
+that�64�mystruct�0�BYTE
+this�64�mystruct�0�BYTE
 upper�64�shortname_info�0�unsigned char:1
 valid�64�shortname_info�0�unsigned char:1


Modified: tests/ctags/bug1466117.c.tags
4 lines changed, 0 insertions(+), 4 deletions(-)
===================================================================
@@ -1,8 +1,4 @@
 # format=tagmanager
-__anon1�2048�0
-a�64�__anon1�0�int
 a�64�mystruct�0�int
-b�64�__anon1�0�int
 b�64�mystruct�0�int
 mystruct�2048�0
-mystruct�4096�0�__anon1


Modified: tests/ctags/bug1491666.c.tags
7 lines changed, 3 insertions(+), 4 deletions(-)
===================================================================
@@ -1,6 +1,5 @@
 # format=tagmanager
-__anon1�2048�0
 main�16�(void)�0�void
-my_struct�4096�0�__anon1
-x�64�__anon1�0�int
-y�64�__anon1�0�float
+my_struct�2048�0
+x�64�my_struct�0�int
+y�64�my_struct�0�float


Modified: tests/ctags/bug556646.c.tags
41 lines changed, 20 insertions(+), 21 deletions(-)
===================================================================
@@ -1,22 +1,21 @@
 # format=tagmanager
-A�4�__anon1�0
-INDX_C1�4�__anon1�0
-INDX_C2�4�__anon1�0
-INDX_IM1�4�__anon1�0
-INDX_IM2�4�__anon1�0
-INDX_L�4�__anon1�0
-INDX_L2�4�__anon1�0
-INDX_M�4�__anon1�0
-INDX_NIL�4�__anon1�0
-INDX_P�4�__anon1�0
-INDX_R�4�__anon1�0
-INDX_R2�4�__anon1�0
-INDX_S�4�__anon1�0
-INDX_S1�4�__anon1�0
-INDX_S2�4�__anon1�0
-INDX_S3�4�__anon1�0
-INDX_S4�4�__anon1�0
-INDX_T�4�__anon1�0
-INDX_T2�4�__anon1�0
-__anon1�2�0
-task_indx_type�4096�0�__anon1
+A�4�task_indx_type�0
+INDX_C1�4�task_indx_type�0
+INDX_C2�4�task_indx_type�0
+INDX_IM1�4�task_indx_type�0
+INDX_IM2�4�task_indx_type�0
+INDX_L�4�task_indx_type�0
+INDX_L2�4�task_indx_type�0
+INDX_M�4�task_indx_type�0
+INDX_NIL�4�task_indx_type�0
+INDX_P�4�task_indx_type�0
+INDX_R�4�task_indx_type�0
+INDX_R2�4�task_indx_type�0
+INDX_S�4�task_indx_type�0
+INDX_S1�4�task_indx_type�0
+INDX_S2�4�task_indx_type�0
+INDX_S3�4�task_indx_type�0
+INDX_S4�4�task_indx_type�0
+INDX_T�4�task_indx_type�0
+INDX_T2�4�task_indx_type�0
+task_indx_type�2�0


Modified: tests/ctags/bug639639.h.tags
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1,5 +1,5 @@
 # format=tagmanager
 Namespace1�256�0
-__anon1�2�0
-anon2�4�__anon1�0
+anon2�4�anon_enum_1�0
+anon_enum_1�2�1
 function2�1024�(char * str)�Namespace1�0�int


Modified: tests/ctags/bug639644.hpp.tags
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1,3 +1,3 @@
 # format=tagmanager
-__anon1�256�0
-foo�16384�__anon1�0�int
+anon_namespace_1�256�1
+foo�16384�anon_namespace_1�0�int


Modified: tests/ctags/complex-return.js.tags
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1,6 +1,6 @@
 # format=tagmanager
-AnonymousFunction1�16�()�class2.c2m1�0
-AnonymousFunction2�16�(n)�class3.c3m1�0
+anon_function_1�16�()�class2.c2m1�1
+anon_function_2�16�(n)�class3.c3m1�1
 c2m1�128�()�class2�0
 c2m2�128�(f)�class2�0
 c2m3�128�(f)�class2�0


Modified: tests/ctags/enum.f90.tags
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1,8 +1,6 @@
 # format=tagmanager
 Constants�256�0
 E_e�16384�Constants�0
-Enum#0�2�Constants�0
-Enum#1�2�Constants�0
 Named1�2�Constants�0
 Named2�2�Constants�0
 Named3�2�Constants�0
@@ -11,6 +9,8 @@ Named5
 Named6�2�Constants�0
 Named7�2�Constants�0
 a�4�Enum#1�0
+anon_enum_1�2�Constants�1
+anon_enum_2�2�Constants�1
 b�4�Enum#1�0
 black�4�Enum#0�0
 blue�4�Enum#0�0


Modified: tests/ctags/enumerators.f90.tags
18 lines changed, 9 insertions(+), 9 deletions(-)
===================================================================
@@ -3,27 +3,27 @@ Aster_colon
 Aster_kind�2�Enums�0
 BodyPart�2�Enums�0
 Colons�2�Enums�0
-Enum#0�2�Enums�0
-Enum#1�2�Enums�0
 Enums�256�0
 Func�16�Enums�0
 Name_colon�2�Enums�0
 Paren_colon�2�Enums�0
 Paren_kind�2�Enums�0
+anon_enum_1�2�Enums�1
+anon_enum_2�2�Enums�1
 arm�4�BodyPart�0
 b�4�Paren_kind�0
-blue�4�Enum#0�0
-bronze�4�Enum#0�0
+blue�4�anon_enum_1�0
+bronze�4�anon_enum_1�0
 c�4�Aster_kind�0
 d�4�Name_colon�0
 d�4�Paren_colon�0
 e�4�Aster_colon�0
-gold�4�Enum#0�0
+gold�4�anon_enum_1�0
 leg�4�BodyPart�0
-no_c_binding�4�Enum#1�0
+no_c_binding�4�anon_enum_2�0
 othervar�16384�Enums�0
-purple�4�Enum#0�0
+purple�4�anon_enum_1�0
 r�4�Colons�0
-red�4�Enum#0�0
-silver�4�Enum#0�0
+red�4�anon_enum_1�0
+silver�4�anon_enum_1�0
 somevar�16384�Enums�0


Modified: tests/ctags/interfaces.f90.tags
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2,7 +2,7 @@
 Func1�16�HasInterfaces�0
 Func2�16�HasInterfaces�0
 HasInterfaces�256�0
-Interface#0�32�HasInterfaces�0
 Main�2048�0
 MyFunc�32�HasInterfaces�0
 MySubroutine�32�Main�0
+anon_interface_1�32�HasInterfaces�1


Modified: tests/ctags/namespace.cpp.tags
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1,7 +1,7 @@
 # format=tagmanager
-__anon1�256�0
 a�256�0
 a_b_f�16�()�a::b�0�void
 a_f�16�()�a�0�void
-anon_f�16�()�__anon1�0�void
+anon_f�16�()�anon_namespace_1�0�void
+anon_namespace_1�256�1
 b�256�a�0


Modified: tests/ctags/numlib.f90.tags
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1,3 +1,3 @@
 # format=tagmanager
-Interface#0�32�numerical_libraries�0
+anon_interface_1�32�numerical_libraries�1
 numerical_libraries�256�0


Modified: tests/ctags/process_order.c.tags
12 lines changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -1,7 +1,7 @@
 # format=tagmanager
-I1_E1�4�__anon1�0
-I1_E2�4�__anon1�0
-I2_E1�4�__anon2�0
-I2_E2�4�__anon2�0
-__anon1�2�0
-__anon2�2�0
+I1_E1�4�anon_enum_1�0
+I1_E2�4�anon_enum_1�0
+I2_E1�4�anon_enum_2�0
+I2_E2�4�anon_enum_2�0
+anon_enum_1�2�1
+anon_enum_2�2�1


Modified: tests/ctags/recursive.f95.tags
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -1,6 +1,6 @@
 # format=tagmanager
-Interface#0�32�approx�0
-Interface#1�32�approx2�0
+anon_interface_1�32�approx�1
+anon_interface_2�32�approx2�1
 approx�256�0
 approx2�256�0
 parts�16384�approx�0


Modified: tests/ctags/structure.f.tags
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1,6 +1,6 @@
 # format=tagmanager
-Structure#0�1�nested�0
 a�64�Structure#0�0
+anon_type_1�1�nested�1
 clouds�64�weather�0
 day�64�weather�0
 initialized_structure�2048�0



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list