Skip to content

Commit

Permalink
clean up NESTML grammar definition
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Nov 30, 2024
1 parent 7b3f127 commit 761cc86
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pynestml/meta_model/ast_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pynestml/meta_model/ast_node_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pynestml/visitors/ast_builder_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 761cc86

Please sign in to comment.