Skip to content

Commit

Permalink
Modify SL node parser to avoid duplicate SLBlockNode
Browse files Browse the repository at this point in the history
  • Loading branch information
DSouzaM committed Jan 29, 2024
1 parent 0dfdc42 commit e245527
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ public Void visitFunction(FunctionContext ctx) {
methodNodes.add(assignment);
}

SLStatementNode bodyNode = statementVisitor.visitBlock(ctx.body);
SLBlockNode bodyNode = (SLBlockNode) statementVisitor.visitBlock(ctx.body);

exitFunction();

methodNodes.add(bodyNode);
methodNodes.addAll(bodyNode.getStatements());
final int bodyEndPos = bodyNode.getSourceEndIndex();
final SourceSection functionSrc = source.createSection(functionStartPos, bodyEndPos - functionStartPos);
final SLStatementNode methodBlock = new SLBlockNode(methodNodes.toArray(new SLStatementNode[methodNodes.size()]));
Expand Down

0 comments on commit e245527

Please sign in to comment.