private AssertStatement VisitAssert(AssertStatement assert) { assert.booleanExpr = this.VisitExpression(assert.booleanExpr); return assert; }
private AssertStatement VisitAssert(AssertStatement assert) { if (assert.Comment != null) { WriteStart("assert("); this.VisitExpression(assert.booleanExpr); Write(", @\"{0}\"", assert.Comment.Replace("\"", "\"\"")); WriteFinish(");"); } else { WriteStart("assert"); this.VisitParenthesizedExpression(assert.booleanExpr); WriteFinish(";"); } return assert; }
// // Handle code generation unique to various Zing statements // private Statement VisitAssert(AssertStatement assert) { Statement assertStmt; assertStmt = Templates.GetStatementTemplate( assert.Comment != null ? "AssertWithComment" : "AssertWithoutComment"); Replacer.Replace(assertStmt, "_exprString", new Literal(assert.booleanExpr.SourceContext.SourceText, SystemTypes.String)); Replacer.Replace(assertStmt, "_expr", this.VisitExpression(assert.booleanExpr)); if (assert.Comment != null) Replacer.Replace(assertStmt, "_comment", new Literal(assert.Comment, SystemTypes.String)); return assertStmt; }
private AssertStatement VisitAssert(AssertStatement assert) { if (assert == null) return null; AssertStatement result = (AssertStatement)assert.Clone(); result.booleanExpr = this.VisitExpression(assert.booleanExpr); return result; }
private AssertStatement VisitAssert(AssertStatement assert) { BasicBlock block = AddBlock(new BasicBlock(assert, CurrentContinuation)); CurrentContinuation = block; return assert; }
private AssertStatement VisitAssert(AssertStatement assert) { if (assert == null) return null; assert.booleanExpr = this.VisitExpression(assert.booleanExpr); if (assert.booleanExpr == null) return null; if (assert.booleanExpr.Type != SystemTypes.Boolean) { this.HandleError(assert, Error.BooleanExpressionRequired); return null; } return assert; }
private AssertStatement VisitAssert(AssertStatement assert) { if (assert == null) return null; assert.booleanExpr = this.VisitExpression(assert.booleanExpr); return assert; }