-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6824b77
commit 451e686
Showing
4 changed files
with
62 additions
and
9 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
38 changes: 38 additions & 0 deletions
38
src/main/java/org/queenlang/transpiler/nodes/QueenThrowStatementNode.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,38 @@ | ||
package org.queenlang.transpiler.nodes; | ||
|
||
import com.github.javaparser.ast.Node; | ||
import com.github.javaparser.ast.stmt.BlockStmt; | ||
import com.github.javaparser.ast.stmt.ThrowStmt; | ||
|
||
/** | ||
* Queen Throw AST Node. | ||
* @author Mihai Andronache ([email protected]) | ||
* @version $Id$ | ||
* @since 0.0.1 | ||
*/ | ||
public final class QueenThrowStatementNode implements QueenStatementNode { | ||
|
||
private final Position position; | ||
|
||
private final QueenExpressionNode expression; | ||
|
||
public QueenThrowStatementNode( | ||
final Position position, | ||
final QueenExpressionNode expression | ||
) { | ||
this.position = position; | ||
this.expression = expression; | ||
} | ||
|
||
@Override | ||
public void addToJavaNode(final Node java) { | ||
ThrowStmt throwStmt = new ThrowStmt(); | ||
this.expression.addToJavaNode(throwStmt); | ||
((BlockStmt) java).addStatement(throwStmt); | ||
} | ||
|
||
@Override | ||
public Position position() { | ||
return this.position; | ||
} | ||
} |
451e686
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amihaiemil I've opened the Issues [#64] for the newly added to-dos.
The to-dos may have been added in an earlier commit, but I've found them just now.
451e686
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amihaiemil I've closed the Issues [#63] since their to-dos disappeared from the code.
The to-dos may have been removed in an earlier commit, but I've found it just now.