Skip to content

Commit

Permalink
PowerShell: parse the class implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarstack55 committed Sep 4, 2022
1 parent 2147102 commit d45a7a4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions parsers/powershell.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,11 @@ static bool parseClass (tokenInfo *const token)

makeClassTag (nameFree);

while (token->type != TOKEN_OPEN_CURLY && token->type != TOKEN_EOF)
{
readToken (token);
}

if (token->type == TOKEN_OPEN_CURLY)
enterScope (token, nameFree->string, K_CLASS);
else
Expand All @@ -572,8 +577,9 @@ static bool parseVariable (tokenInfo *const token)
readToken (token);
if (token->type == TOKEN_EQUAL_SIGN)
{
if (token->parentKind != K_FUNCTION)
{ /* ignore local variables (i.e. within a function) */
if (token->parentKind != K_FUNCTION && token->parentKind != K_CLASS)
{ /* ignore local variables (i.e. within a function)
* TODO: Parses class properties to make tags. */
access = parsePowerShellScope (name);
makeSimplePowerShellTag (name, K_VARIABLE, access);
readNext = true;
Expand Down

0 comments on commit d45a7a4

Please sign in to comment.