Skip to content

Commit 50f60b8

Browse files
authored
Merge pull request #3533 from masatake/powershell--readTagsFull
PowerShell,refactor: don't use output parameter as input
2 parents da7ee9f + 79ee95a commit 50f60b8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

parsers/powershell.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int skipSingleComment (void)
303303
return c;
304304
}
305305

306-
static void readToken (tokenInfo *const token)
306+
static void readTokenFull (tokenInfo *const token, bool includingScope)
307307
{
308308
int c;
309309

@@ -408,8 +408,7 @@ static void readToken (tokenInfo *const token)
408408
token->type = TOKEN_UNDEFINED;
409409
else
410410
{
411-
if (token->keyword == KEYWORD_function ||
412-
token->keyword == KEYWORD_filter)
411+
if (includingScope)
413412
parseScopeIdentifier (token->string, c);
414413
else
415414
parseIdentifier (token->string, c);
@@ -424,6 +423,11 @@ static void readToken (tokenInfo *const token)
424423
}
425424
}
426425

426+
static void readToken (tokenInfo *const token)
427+
{
428+
readTokenFull (token, false);
429+
}
430+
427431
static void enterScope (tokenInfo *const parentToken,
428432
const vString *const extraScope,
429433
const int parentKind);
@@ -470,7 +474,7 @@ static bool parseFunction (tokenInfo *const token, int kind)
470474
tokenInfo *nameFree = NULL;
471475
const char *access;
472476

473-
readToken (token);
477+
readTokenFull (token, true);
474478

475479
if (token->type != TOKEN_IDENTIFIER)
476480
return false;

0 commit comments

Comments
 (0)