json: Fix handling of tags containing a dot

X-Universal-CTags-Commit-ID: 7ae28a3d8a7ad5f8a9d6399a4e357fcf19ad2b2e
This commit is contained in:
Colomban Wendling 2015-06-09 15:06:12 +02:00
parent f30b72d91e
commit 944bffb967
4 changed files with 47 additions and 9 deletions

View File

@ -227,15 +227,7 @@ static void pushScope (tokenInfo *const token,
static void popScope (tokenInfo *const token, static void popScope (tokenInfo *const token,
const tokenInfo *const parent) const tokenInfo *const parent)
{ {
char *dot = strrchr (token->scope->buffer, '.'); vStringTruncate (token->scope, vStringLength (parent->scope));
if (! dot)
vStringClear (token->scope);
else
{
*dot = 0;
token->scope->length = dot - token->scope->buffer;
}
token->scopeKind = parent->scopeKind; token->scopeKind = parent->scopeKind;
} }

View File

@ -134,6 +134,7 @@ test_sources = \
debian_432872.f90 \ debian_432872.f90 \
directives.c \ directives.c \
dopbl2.f \ dopbl2.f \
dotted-names.json \
enum.c \ enum.c \
enum.f90 \ enum.f90 \
enum.java \ enum.java \

View File

@ -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
}

View File

@ -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