diff --git a/pynestml/meta_model/ast_model.py b/pynestml/meta_model/ast_model.py index c4b7374bf..f2fae8021 100644 --- a/pynestml/meta_model/ast_model.py +++ b/pynestml/meta_model/ast_model.py @@ -450,7 +450,7 @@ def create_empty_update_block(self): """ assert not self.get_update_blocks(), "create_empty_update_block() called although update block already present" from pynestml.meta_model.ast_node_factory import ASTNodeFactory - block = ASTNodeFactory.create_ast_block([], ASTSourceLocation.get_predefined_source_position()) + block = ASTNodeFactory.create_ast_stmts_body([], ASTSourceLocation.get_predefined_source_position()) update_block = ASTNodeFactory.create_ast_update_block(block, ASTSourceLocation.get_predefined_source_position()) self.get_body().get_body_elements().append(update_block) diff --git a/pynestml/meta_model/ast_node_factory.py b/pynestml/meta_model/ast_node_factory.py index 63775f023..012343147 100644 --- a/pynestml/meta_model/ast_node_factory.py +++ b/pynestml/meta_model/ast_node_factory.py @@ -100,7 +100,7 @@ def create_ast_bit_operator(cls, is_bit_and=False, is_bit_xor=False, is_bit_or=F return ASTBitOperator(is_bit_and, is_bit_xor, is_bit_or, is_bit_shift_left, is_bit_shift_right, source_position=source_position) @classmethod - def create_ast_block(cls, stmts, source_position): + def create_ast_stmts_body(cls, stmts, source_position): # type: (list(ASTSmallStmt|ASTCompoundStmt),ASTSourceLocation) -> ASTStmtsBody return ASTStmtsBody(stmts, source_position=source_position) diff --git a/pynestml/visitors/ast_builder_visitor.py b/pynestml/visitors/ast_builder_visitor.py index edcab7a22..5c0a48c55 100644 --- a/pynestml/visitors/ast_builder_visitor.py +++ b/pynestml/visitors/ast_builder_visitor.py @@ -330,7 +330,7 @@ def visitStmtsBody(self, ctx): if ctx.stmt() is not None: for stmt in ctx.stmt(): stmts.append(self.visit(stmt)) - block = ASTNodeFactory.create_ast_block(stmts=stmts, source_position=create_source_pos(ctx)) + block = ASTNodeFactory.create_stmts_body(stmts=stmts, source_position=create_source_pos(ctx)) return block # Visit a parse tree produced by PyNESTMLParser#compound_Stmt.