Skip to content

Commit

Permalink
Merge pull request #941 from b4n/objc/uctags-update
Browse files Browse the repository at this point in the history
Import Objective-C parser changes from universal-ctags
  • Loading branch information
b4n committed Mar 7, 2016
2 parents 7ba7fa0 + bef0669 commit 69d7a1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tagmanager/ctags/objc.c
Expand Up @@ -51,7 +51,7 @@ typedef enum {
static kindOption ObjcKinds[] = {
{TRUE, 'i', "interface", "class interface"},
{TRUE, 'I', "implementation", "class implementation"},
{TRUE, 'p', "protocol", "Protocol"},
{TRUE, 'P', "protocol", "Protocol"},
{TRUE, 'm', "method", "Object's method"},
{TRUE, 'c', "class", "Class' method"},
{TRUE, 'v', "var", "Global variable"},
Expand Down Expand Up @@ -482,6 +482,10 @@ static void popEnclosingContext (void)
static void addTag (vString * const ident, int kind)
{
tagEntryInfo toCreate;

if (! ObjcKinds[kind].enabled)
return;

prepareTag (&toCreate, ident, kind);
makeTagEntry (&toCreate);
}
Expand Down Expand Up @@ -565,7 +569,7 @@ static void parseFields (vString * const ident, objcToken what)
}
}

objcKind methodKind;
static objcKind methodKind;


static vString *fullMethodName;
Expand Down Expand Up @@ -702,6 +706,7 @@ static void parseProperty (vString * const ident, objcToken what)
case Tok_semi:
addTag (tempName, K_PROPERTY);
vStringClear (tempName);
toDoNext = &parseMethods;
break;

default:
Expand Down Expand Up @@ -1117,6 +1122,7 @@ static void findObjcTags (void)
(*toDoNext) (st.name, tok);
tok = lex (&st);
}
vStringDelete(st.name);

vStringDelete (name);
vStringDelete (parentName);
Expand Down
1 change: 1 addition & 0 deletions tests/ctags/objectivec_property.mm.tags
@@ -1,4 +1,5 @@
# format=tagmanager
Person�32�0
initWithAge:�128�Person�0
m_age�8�Person�0
m_name�8�Person�0

0 comments on commit 69d7a1a

Please sign in to comment.