Skip to content

Commit edad259

Browse files
committed
Merge
2 parents 223cc84 + 40e105f commit edad259

92 files changed

Lines changed: 1060 additions & 285 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Additionally, you'll need the following dependency, which includes the LiquidJav
5252
<dependency>
5353
<groupId>io.github.liquid-java</groupId>
5454
<artifactId>liquidjava-api</artifactId>
55-
<version>0.0.4</version>
55+
<version>0.0.5</version>
5656
</dependency>
5757
```
5858

@@ -63,7 +63,7 @@ repositories {
6363
}
6464
6565
dependencies {
66-
implementation 'io.github.liquid-java:liquidjava-api:0.0.4'
66+
implementation 'io.github.liquid-java:liquidjava-api:0.0.5'
6767
}
6868
```
6969

liquidjava-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>io.github.liquid-java</groupId>
1313
<artifactId>liquidjava-api</artifactId>
14-
<version>0.0.4</version>
14+
<version>0.0.5</version>
1515
<name>liquidjava-api</name>
1616
<description>LiquidJava API</description>
1717
<url>https://github.com/liquid-java/liquidjava</url>

liquidjava-api/src/main/java/liquidjava/specification/Ghost.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
@Retention(RetentionPolicy.RUNTIME)
2828
@Target({ElementType.TYPE})
29-
@Repeatable(GhostMultiple.class)
29+
@Repeatable(Ghost.Multiple.class)
3030
public @interface Ghost {
3131

3232
/**
@@ -40,4 +40,13 @@
4040
* </pre>
4141
*/
4242
String value();
43+
44+
/**
45+
* Container annotation used by {@link Repeatable} to support multiple ghost declarations.
46+
*/
47+
@Retention(RetentionPolicy.RUNTIME)
48+
@Target({ElementType.TYPE})
49+
@interface Multiple {
50+
Ghost[] value();
51+
}
4352
}

liquidjava-api/src/main/java/liquidjava/specification/GhostMultiple.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

liquidjava-api/src/main/java/liquidjava/specification/RefinementAlias.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
@Retention(RetentionPolicy.RUNTIME)
3030
@Target({ElementType.TYPE})
31-
@Repeatable(RefinementAliasMultiple.class)
31+
@Repeatable(RefinementAlias.Multiple.class)
3232
public @interface RefinementAlias {
3333

3434
/**
@@ -42,4 +42,13 @@
4242
* </pre>
4343
*/
4444
String value();
45+
46+
/**
47+
* Container annotation used by {@link Repeatable} to support multiple refinement aliases.
48+
*/
49+
@Retention(RetentionPolicy.RUNTIME)
50+
@Target({ElementType.TYPE})
51+
@interface Multiple {
52+
RefinementAlias[] value();
53+
}
4554
}

liquidjava-api/src/main/java/liquidjava/specification/RefinementAliasMultiple.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

liquidjava-api/src/main/java/liquidjava/specification/RefinementPredicate.java

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@
77
import java.lang.annotation.Target;
88

99
/**
10-
* Annotation that allows the creation of ghost variables or refinement aliases within method or constructor scope.
10+
* Annotation that allows the creation of custom ghost functions within classes or interfaces.
1111
* <p>
12-
* This annotation enables the declaration of ghosts and refinement aliases.
12+
* This annotation enables the declaration of custom ghost functions.
1313
* <p>
1414
* <strong>Example:</strong>
1515
* <pre>
1616
* {@code
17-
* @RefinementPredicate("ghost int size")
18-
* @RefinementPredicate("type Nat(int x) { x > 0 }")
19-
* public void process() {
20-
* // ...
17+
* @RefinementPredicate("int totalPrice(Order o)")
18+
* public class Order {
19+
* @StateRefinement(to = "totalPrice(this) == 0")
20+
* public Order() {
21+
* }
2122
* }
2223
* }
2324
* </pre>
@@ -27,20 +28,28 @@
2728
* @author Catarina Gamboa
2829
*/
2930
@Retention(RetentionPolicy.RUNTIME)
30-
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
31-
@Repeatable(RefinementPredicateMultiple.class)
31+
@Target({ElementType.TYPE})
32+
@Repeatable(RefinementPredicate.Multiple.class)
3233
public @interface RefinementPredicate {
3334

3435
/**
35-
* The refinement predicate string, which can define a ghost variable or a refinement alias.
36+
* The refinement predicate string, which defines a ghost function declaration.
3637
* <p>
3738
* <strong>Example:</strong>
3839
* <pre>
3940
* {@code
40-
* @RefinementPredicate("ghost int size")
41-
* @RefinementPredicate("type Nat(int x) { x > 0 }")
41+
* @RefinementPredicate("int totalPrice(Order o)")
4242
* }
4343
* </pre>
4444
*/
4545
String value();
46+
47+
/**
48+
* Container annotation used by {@link Repeatable} to support multiple refinement predicates.
49+
*/
50+
@Retention(RetentionPolicy.RUNTIME)
51+
@Target({ElementType.TYPE})
52+
@interface Multiple {
53+
RefinementPredicate[] value();
54+
}
4655
}

liquidjava-api/src/main/java/liquidjava/specification/RefinementPredicateMultiple.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

liquidjava-api/src/main/java/liquidjava/specification/StateRefinement.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
@Retention(RetentionPolicy.RUNTIME)
3030
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
31-
@Repeatable(StateRefinementMultiple.class)
31+
@Repeatable(StateRefinement.Multiple.class)
3232
public @interface StateRefinement {
3333

3434
/**
@@ -66,4 +66,13 @@
6666
* </pre>
6767
*/
6868
String msg() default "";
69+
70+
/**
71+
* Container annotation used by {@link Repeatable} to support multiple state transitions.
72+
*/
73+
@Retention(RetentionPolicy.RUNTIME)
74+
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
75+
@interface Multiple {
76+
StateRefinement[] value();
77+
}
6978
}

liquidjava-api/src/main/java/liquidjava/specification/StateRefinementMultiple.java

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)