-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41683 from lochana-chathura/worker_new
Add parsing support for new worker related syntax
- Loading branch information
Showing
32 changed files
with
4,441 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...rc/main/java/io/ballerina/compiler/internal/parser/tree/STAlternateReceiveWorkerNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package io.ballerina.compiler.internal.parser.tree; | ||
|
||
import io.ballerina.compiler.syntax.tree.AlternateReceiveWorkerNode; | ||
import io.ballerina.compiler.syntax.tree.Node; | ||
import io.ballerina.compiler.syntax.tree.NonTerminalNode; | ||
import io.ballerina.compiler.syntax.tree.SyntaxKind; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
/** | ||
* This is a generated internal syntax tree node. | ||
* | ||
* @since 2201.9.0 | ||
*/ | ||
public class STAlternateReceiveWorkerNode extends STNode { | ||
public final STNode workers; | ||
|
||
STAlternateReceiveWorkerNode( | ||
STNode workers) { | ||
this( | ||
workers, | ||
Collections.emptyList()); | ||
} | ||
|
||
STAlternateReceiveWorkerNode( | ||
STNode workers, | ||
Collection<STNodeDiagnostic> diagnostics) { | ||
super(SyntaxKind.ALTERNATE_RECEIVE_WORKER, diagnostics); | ||
this.workers = workers; | ||
|
||
addChildren( | ||
workers); | ||
} | ||
|
||
public STNode modifyWith(Collection<STNodeDiagnostic> diagnostics) { | ||
return new STAlternateReceiveWorkerNode( | ||
this.workers, | ||
diagnostics); | ||
} | ||
|
||
public STAlternateReceiveWorkerNode modify( | ||
STNode workers) { | ||
if (checkForReferenceEquality( | ||
workers)) { | ||
return this; | ||
} | ||
|
||
return new STAlternateReceiveWorkerNode( | ||
workers, | ||
diagnostics); | ||
} | ||
|
||
public Node createFacade(int position, NonTerminalNode parent) { | ||
return new AlternateReceiveWorkerNode(this, position, parent); | ||
} | ||
|
||
@Override | ||
public void accept(STNodeVisitor visitor) { | ||
visitor.visit(this); | ||
} | ||
|
||
@Override | ||
public <T> T apply(STNodeTransformer<T> transformer) { | ||
return transformer.transform(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.