Skip to content

Commit

Permalink
enum_block , ability_def
Browse files Browse the repository at this point in the history
  • Loading branch information
chathura-1224 committed Jan 31, 2025
1 parent 63d8ec8 commit 03fc480
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jac/jaclang/compiler/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,9 @@ def enum_block(
enum_block: LBRACE ((enum_stmt COMMA)* enum_stmt COMMA?)? RBRACE
"""
ret = ast.SubNodeList[ast.EnumBlockStmt](items=[], delim=Tok.COMMA, kid=self.nodes)
ret = ast.SubNodeList[ast.EnumBlockStmt](
items=[], delim=Tok.COMMA, kid=self.nodes
)
ret.items = [i for i in self.nodes if isinstance(i, ast.EnumBlockStmt)]
return ret

Expand Down Expand Up @@ -902,7 +904,10 @@ def ability_def(self, kid: list[ast.AstNode]) -> ast.AbilityDef:
"""
if (
(ability_def_target := self.match(ast.ArchRefChain))
and (ability_def_sign := self.match(ast.FuncSignature) or self.match(ast.EventSignature))
and (
ability_def_sign := self.match(ast.FuncSignature)
or self.match(ast.EventSignature)
)
and (ability_def_body := self.match(ast.SubNodeList))
):
return ast.AbilityDef(
Expand Down

0 comments on commit 03fc480

Please sign in to comment.