Skip to content

Commit

Permalink
Merge pull request universal-ctags#3533 from masatake/powershell--rea…
Browse files Browse the repository at this point in the history
…dTagsFull

PowerShell,refactor: don't use output parameter as input
  • Loading branch information
masatake authored Nov 15, 2022
2 parents da7ee9f + 79ee95a commit 50f60b8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions parsers/powershell.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ static int skipSingleComment (void)
return c;
}

static void readToken (tokenInfo *const token)
static void readTokenFull (tokenInfo *const token, bool includingScope)
{
int c;

Expand Down Expand Up @@ -408,8 +408,7 @@ static void readToken (tokenInfo *const token)
token->type = TOKEN_UNDEFINED;
else
{
if (token->keyword == KEYWORD_function ||
token->keyword == KEYWORD_filter)
if (includingScope)
parseScopeIdentifier (token->string, c);
else
parseIdentifier (token->string, c);
Expand All @@ -424,6 +423,11 @@ static void readToken (tokenInfo *const token)
}
}

static void readToken (tokenInfo *const token)
{
readTokenFull (token, false);
}

static void enterScope (tokenInfo *const parentToken,
const vString *const extraScope,
const int parentKind);
Expand Down Expand Up @@ -470,7 +474,7 @@ static bool parseFunction (tokenInfo *const token, int kind)
tokenInfo *nameFree = NULL;
const char *access;

readToken (token);
readTokenFull (token, true);

if (token->type != TOKEN_IDENTIFIER)
return false;
Expand Down

0 comments on commit 50f60b8

Please sign in to comment.