[geany/geany] 944bff: json: Fix handling of tags containing a dot

Colomban Wendling git-noreply at xxxxx
Sun Jun 14 15:29:04 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 14 Jun 2015 15:29:04 UTC
Commit:      944bffb9673660b4d0b37fee2037541b148f0627
             https://github.com/geany/geany/commit/944bffb9673660b4d0b37fee2037541b148f0627

Log Message:
-----------
json: Fix handling of tags containing a dot

X-Universal-CTags-Commit-ID: 7ae28a3d8a7ad5f8a9d6399a4e357fcf19ad2b2e


Modified Paths:
--------------
    tagmanager/ctags/json.c
    tests/ctags/Makefile.am
    tests/ctags/dotted-names.json
    tests/ctags/dotted-names.json.tags

Modified: tagmanager/ctags/json.c
10 lines changed, 1 insertions(+), 9 deletions(-)
===================================================================
@@ -227,15 +227,7 @@ static void pushScope (tokenInfo *const token,
 static void popScope (tokenInfo *const token,
 					  const tokenInfo *const parent)
 {
-	char *dot = strrchr (token->scope->buffer, '.');
-
-	if (! dot)
-		vStringClear (token->scope);
-	else
-	{
-		*dot = 0;
-		token->scope->length = dot - token->scope->buffer;
-	}
+	vStringTruncate (token->scope, vStringLength (parent->scope));
 	token->scopeKind = parent->scopeKind;
 }
 


Modified: tests/ctags/Makefile.am
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -134,6 +134,7 @@ test_sources = \
 	debian_432872.f90				\
 	directives.c					\
 	dopbl2.f						\
+	dotted-names.json				\
 	enum.c							\
 	enum.f90						\
 	enum.java						\


Modified: tests/ctags/dotted-names.json
25 lines changed, 25 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,25 @@
+{
+  "first.name": "John",
+  "last.name": "Smith",
+  "is.alive": true,
+  "age": 25,
+  "height_cm": 167.6,
+  "address": {
+    "street.address": "21 2nd Street",
+    "city": "New York",
+    "state": "NY",
+    "postal.code": "10021-3100"
+  },
+  "phone.numbers": [
+    {
+      "type": "home",
+      "number": "212 555-1234"
+    },
+    {
+      "type": "office",
+      "number": "646 555-4567"
+    }
+  ],
+  "children": [],
+  "spouse": null
+}


Modified: tests/ctags/dotted-names.json.tags
20 lines changed, 20 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,20 @@
+# format=tagmanager
+0�64�phone.numbers�0
+1�64�phone.numbers�0
+address�64�0
+age�64�0
+children�64�0
+city�64�address�0
+first.name�64�0
+height_cm�64�0
+is.alive�64�0
+last.name�64�0
+number�64�phone.numbers.0�0
+number�64�phone.numbers.1�0
+phone.numbers�64�0
+postal.code�64�address�0
+spouse�64�0
+state�64�address�0
+street.address�64�address�0
+type�64�phone.numbers.0�0
+type�64�phone.numbers.1�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