Skip to content

Commit

Permalink
missing jml delimiters in pretty printing
Browse files Browse the repository at this point in the history
  • Loading branch information
wadoon committed May 23, 2024
1 parent 6cca21e commit 7250734
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion javaparser-core-generators/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion javaparser-core-metamodel-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion javaparser-core-serialization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion javaparser-core-testing-bdd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion javaparser-core-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion javaparser-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,8 @@ public void visit(JmlRepresentsDeclaration n, Void arg) {
@Override
public void visit(JmlContract n, Void arg) {
printOrphanCommentsBeforeThisChildNode(n);
boolean openedJml = inJmlComment();
if (!openedJml) startJmlComment(false, n.getJmlTags());
printModifiers(n.getModifiers());
printer.print(" ");
printer.print(n.getBehavior().jmlSymbol());
Expand All @@ -982,12 +984,13 @@ public void visit(JmlContract n, Void arg) {
printer.indent();
printList(n.getSubContracts(), "", "", "", "{|\n", "|}");
printer.unindent().unindent();
if (!openedJml) endJmlComment();
}

private void endJmlComment() {
assert inJmlComment() && inJmlSingleComment != inJmlMultiComment;
if (inJmlSingleComment) {
printer.print("");
printer.println("");
} else {
printer.println("*/");
}
Expand Down
2 changes: 1 addition & 1 deletion javaparser-symbol-solver-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion javaparser-symbol-solver-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion jmlparser-jml-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>jmlparser-parent</artifactId>
<groupId>io.github.jmltoolkit</groupId>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.github.javaparser.jml.JmlDocSanitizer;
import com.google.common.truth.Truth;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.provider.CsvSource;

import java.io.File;
import java.io.FileWriter;
Expand Down Expand Up @@ -174,6 +175,8 @@ private void testParse(Path p) throws IOException {
Assertions.assertTrue(result.isSuccessful(), "parsing failed");

testParentAndChild(result.getResult().get());

System.out.println(result.getResult().get().toString());
}

private void testParentAndChild(Node node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ public interface Lock {
ensures spec.lockTransfer();
assignable<heap> \strictly_nothing;
assignable<permissions> spec.fpPerm(); @*/
public /*@ helper @*/ native void lock();
public /*@ helper @*/ void lock();

/*@ normal_behavior
requires spec.lockStatus(\dl_TRUE());
ensures spec.lockStatus(\dl_FALSE());
ensures spec.unlockTransfer();
assignable<heap> spec.fp(); // should be done by the prover
assignable<permissions> spec.fpPerm(); @*/
public /*@ helper @*/ native void unlock();
public /*@ helper @*/ void unlock();
}

public class Counter implements LockSpec {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<groupId>io.github.jmltoolkit</groupId>
<artifactId>jmlparser-parent</artifactId>
<packaging>pom</packaging>
<version>3.25.10-b3-SNAPSHOT</version>
<version>3.25.10-b6-SNAPSHOT</version>

<name>jmlparser-parent</name>
<url>https://github.com/wadoon/jmlparser</url>
Expand Down

0 comments on commit 7250734

Please sign in to comment.