()
| 32 | override readonly optional = false; |
| 33 | |
| 34 | override execute(): TcbExpr { |
| 35 | const id = new TcbExpr(this.tcb.allocateId()).addParseSpanInfo(this.node.nameSpan); |
| 36 | const value = tcbExpression(this.node.value, this.tcb, this.scope).wrapForTypeChecker(); |
| 37 | // Value needs to be wrapped, because spans for the expressions inside of it can |
| 38 | // be picked up incorrectly as belonging to the full variable declaration. |
| 39 | const varStatement = new TcbExpr(`const ${id.print()} = ${value.print()}`); |
| 40 | varStatement.addParseSpanInfo(this.node.sourceSpan); |
| 41 | this.scope.addStatement(varStatement); |
| 42 | return id; |
| 43 | } |
| 44 | } |
nothing calls this directly
no test coverage detected