File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 5050import com .oracle .truffle .api .nodes .NodeCost ;
5151import com .oracle .truffle .api .nodes .UnexpectedResultException ;
5252
53+ /**
54+ * Base class for all expressions. Expressions always return a value.
55+ */
5356@ GenerateWrapper
5457public abstract class ExpressionNode extends PNode {
5558
@@ -119,6 +122,10 @@ public NodeCost getCost() {
119122 }
120123 }
121124
125+ /**
126+ * If expressions appear in a block of statements, they are wrapped in a
127+ * {@link StatementNode} that simply drops the result.
128+ */
122129 public final StatementNode asStatement () {
123130 return new ExpressionStatementNode (this );
124131 }
@@ -145,6 +152,11 @@ public boolean hasSideEffectAsAnExpression() {
145152 }
146153 }
147154
155+ /**
156+ * Some expressions can have hidden side-effects such as writing to a
157+ * temporary variable. These can be wrapped together with their side
158+ * effecting {@link StatementNode}.
159+ */
148160 public final ExpressionNode withSideEffect (StatementNode sideEffect ) {
149161 return new ExpressionWithSideEffects (this , sideEffect );
150162 }
Original file line number Diff line number Diff line change 3434import com .oracle .truffle .api .instrumentation .Tag ;
3535
3636/**
37- * Base class for most statements, except for FrameSlotNodes.
38- *
37+ * Base class for all statements. Statements never return a value.
3938 */
4039@ GenerateWrapper
4140public abstract class StatementNode extends PNode {
You can’t perform that action at this time.
0 commit comments