Skip to content

Commit

Permalink
Merge pull request #1654 from masatake/ada-remove-redundant-condition
Browse files Browse the repository at this point in the history
Ada,refactor: delete redundant condition
  • Loading branch information
masatake authored Jan 10, 2018
2 parents c62d3ee + 0478703 commit 796684b
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions parsers/ada.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,35 +2053,34 @@ static void storeAdaTags(adaTokenInfo *token, const char *parentScope)
char *currentScope = NULL;
adaTokenInfo *tmp = NULL;

if(token != NULL)
Assert(token);

/* do a spec transition if necessary */
if(token->isSpec == true)
{
/* do a spec transition if necessary */
if(token->isSpec == true)
{
makeSpec(&token->kind);
makeSpec(&token->kind);

if(token->kind != ADA_KIND_UNDEFINED)
{
token->tag.kindIndex = token->kind;
}
}
if(token->kind != ADA_KIND_UNDEFINED)
{
token->tag.kindIndex = token->kind;
}
}

/* fill in the scope data */
if(token->parent != NULL)
{
if(token->parent->kind > ADA_KIND_UNDEFINED &&
token->parent->kind < ADA_KIND_COUNT)
{
token->tag.extensionFields.scopeKindIndex = token->parent->kind;
token->tag.extensionFields.scopeName = token->parent->name;
}
else if(token->parent->kind == ADA_KIND_SEPARATE)
{
token->tag.extensionFields.scopeKindIndex = ADA_KIND_SEPARATE;
token->tag.extensionFields.scopeName = token->parent->name;
}
} /* else if(token->parent->kind == ADA_KIND_ANONYMOUS) */
} /* if(token->parent != NULL) */
/* fill in the scope data */
if(token->parent != NULL)
{
if(token->parent->kind > ADA_KIND_UNDEFINED &&
token->parent->kind < ADA_KIND_COUNT)
{
token->tag.extensionFields.scopeKindIndex = token->parent->kind;
token->tag.extensionFields.scopeName = token->parent->name;
}
else if(token->parent->kind == ADA_KIND_SEPARATE)
{
token->tag.extensionFields.scopeKindIndex = ADA_KIND_SEPARATE;
token->tag.extensionFields.scopeName = token->parent->name;
}
} /* else if(token->parent->kind == ADA_KIND_ANONYMOUS) */

/* one check before we try to make a tag... If this is an anonymous
* declare block then it's name is empty. Give it one */
Expand Down

0 comments on commit 796684b

Please sign in to comment.