Clean code
This commit is contained in:
@@ -9,11 +9,9 @@ class Block(Node):
|
||||
|
||||
|
||||
def BlockParser(input):
|
||||
parser = Parser.loop(
|
||||
return Parser.loop(
|
||||
Parser.terminalParser(TokenType.OPEN_CURLY),
|
||||
Parser.doAssert(StatementParser, f"statement or '{TokenType.CLOSE_CURLY.key}'"),
|
||||
Parser.terminalParser(TokenType.CLOSE_CURLY),
|
||||
createNode=lambda open, statements, close: Block.withChildren(statements, open.pos)
|
||||
)
|
||||
|
||||
return Parser(parser, "block", [parser])(input)
|
||||
)(input)
|
||||
|
||||
Reference in New Issue
Block a user