| 79 | * Executing this operation returns nothing. |
| 80 | */ |
| 81 | export class TcbConditionOp extends TcbOp { |
| 82 | constructor( |
| 83 | private tcb: Context, |
| 84 | private scope: Scope, |
| 85 | private expression: AST, |
| 86 | ) { |
| 87 | super(); |
| 88 | } |
| 89 | |
| 90 | override get optional() { |
| 91 | return false; |
| 92 | } |
| 93 | |
| 94 | override execute(): null { |
| 95 | const expr = tcbExpression(this.expression, this.tcb, this.scope); |
| 96 | // Wrap in an if-statement to enable TS2774 for uninvoked signals/functions. |
| 97 | this.scope.addStatement(new TcbExpr(`if (${expr.print()}) {}`)); |
| 98 | return null; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | export class TcbExpressionTranslator { |
| 103 | constructor( |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…