From 0f0ee79f225cc9f01f244edb35744b753438e177 Mon Sep 17 00:00:00 2001 From: Petra van den Bos Date: Thu, 25 Mar 2021 16:54:25 +0100 Subject: [PATCH] order of annotations is now preserved --- col/src/main/java/vct/col/ast/print/AbstractPrinter.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/col/src/main/java/vct/col/ast/print/AbstractPrinter.java b/col/src/main/java/vct/col/ast/print/AbstractPrinter.java index 30fe8b2d2b..ec7dae83ab 100644 --- a/col/src/main/java/vct/col/ast/print/AbstractPrinter.java +++ b/col/src/main/java/vct/col/ast/print/AbstractPrinter.java @@ -279,6 +279,7 @@ public void visit(Contract contract) { for (ASTNode post : ASTUtils.conjuncts(contract.post_condition, StandardOperator.Star)) { if (pre.equals(post)) { contextElems.add(pre); + printContractElement(pre, "context"); added = true; } } @@ -286,9 +287,6 @@ public void visit(Contract contract) { printContractElement(pre, "requires"); } } - for (ASTNode con : contextElems) { - printContractElement(con, "context"); - } for (ASTNode post : ASTUtils.conjuncts(contract.post_condition, StandardOperator.Star)) { if (!contextElems.contains(post)) { printContractElement(post, "ensures");