Search in sources :

Example 1 with BlockNode

use of org.ballerinalang.model.tree.statements.BlockNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method endCallableUnitBody.

public void endCallableUnitBody(Set<Whitespace> ws) {
    BlockNode block = this.blockNodeStack.pop();
    InvokableNode invokableNode = this.invokableNodeStack.peek();
    invokableNode.addWS(ws);
    invokableNode.setBody(block);
}
Also used : BlockNode(org.ballerinalang.model.tree.statements.BlockNode) InvokableNode(org.ballerinalang.model.tree.InvokableNode)

Example 2 with BlockNode

use of org.ballerinalang.model.tree.statements.BlockNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method addElseBlock.

public void addElseBlock(DiagnosticPos pos, Set<Whitespace> ws) {
    IfNode ifNode = ifElseStatementStack.peek();
    while (ifNode.getElseStatement() != null) {
        ifNode = (IfNode) ifNode.getElseStatement();
    }
    ifNode.addWS(ws);
    BlockNode elseBlock = blockNodeStack.pop();
    ((BLangBlockStmt) elseBlock).pos = pos;
    ifNode.setElseStatement(elseBlock);
}
Also used : BlockNode(org.ballerinalang.model.tree.statements.BlockNode) IfNode(org.ballerinalang.model.tree.statements.IfNode)

Aggregations

BlockNode (org.ballerinalang.model.tree.statements.BlockNode)2 InvokableNode (org.ballerinalang.model.tree.InvokableNode)1 IfNode (org.ballerinalang.model.tree.statements.IfNode)1