Skip to content

Commit 5c673e4

Browse files
committed
Remove Java relay.
1 parent 83d73d7 commit 5c673e4

File tree

10 files changed

+22
-84
lines changed

10 files changed

+22
-84
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>org.byteskript</groupId>
88
<artifactId>byteskript</artifactId>
9-
<version>1.0.13</version>
9+
<version>1.0.14</version>
1010
<name>ByteSkript</name>
1111
<description>A compiled JVM implementation of the Skript language.</description>
1212

@@ -92,7 +92,7 @@
9292
<dependency>
9393
<groupId>mx.kenzie</groupId>
9494
<artifactId>autodocs</artifactId>
95-
<version>1.0.1</version>
95+
<version>1.0.2</version>
9696
<scope>provided</scope>
9797
</dependency>
9898
<dependency>

src/main/java/org/byteskript/skript/compiler/SkriptLangSpec.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
import org.byteskript.skript.lang.syntax.dictionary.DictionaryMember;
2828
import org.byteskript.skript.lang.syntax.dictionary.ImportFunctionEffect;
2929
import org.byteskript.skript.lang.syntax.dictionary.ImportTypeEffect;
30-
import org.byteskript.skript.lang.syntax.entry.*;
30+
import org.byteskript.skript.lang.syntax.entry.ReturnType;
31+
import org.byteskript.skript.lang.syntax.entry.Template;
32+
import org.byteskript.skript.lang.syntax.entry.Trigger;
33+
import org.byteskript.skript.lang.syntax.entry.Verify;
3134
import org.byteskript.skript.lang.syntax.entry.syntax.*;
3235
import org.byteskript.skript.lang.syntax.event.AnyLoadEvent;
3336
import org.byteskript.skript.lang.syntax.event.CurrentEventExpression;
@@ -249,7 +252,6 @@ private SkriptLangSpec() {
249252
new AnyLoadEvent()
250253
);
251254
generateSyntaxFrom(IOHandlers.class);
252-
generateSyntaxFrom(JavaRelay.class);
253255
try {
254256
registerProperty("keys", GET, DataMap.class.getMethod("getKeys", Map.class));
255257
registerProperty("values", GET, DataMap.class.getMethod("getValues", Map.class));

src/main/java/org/byteskript/skript/lang/syntax/comparison/GT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class GT extends RelationalExpression {
3030

3131
public GT() {
32-
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object% (is greater than|>) ?%Object%");
32+
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object%( is greater than | ?> ?)%Object%");
3333
try {
3434
handlers.put(StandardHandlers.FIND, OperatorHandler.class.getMethod("gt", Object.class, Object.class));
3535
handlers.put(StandardHandlers.GET, OperatorHandler.class.getMethod("gt", Object.class, Object.class));

src/main/java/org/byteskript/skript/lang/syntax/comparison/GTEQ.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class GTEQ extends RelationalExpression {
3030

3131
public GTEQ() {
32-
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object% (is greater than or equal to|>=) ?%Object%");
32+
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object%( is greater than or equal to | ?>= ?)%Object%");
3333
try {
3434
handlers.put(StandardHandlers.FIND, OperatorHandler.class.getMethod("gteq", Object.class, Object.class));
3535
handlers.put(StandardHandlers.GET, OperatorHandler.class.getMethod("gteq", Object.class, Object.class));

src/main/java/org/byteskript/skript/lang/syntax/comparison/IsEqual.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
public class IsEqual extends RelationalExpression {
3232

3333
public IsEqual() {
34-
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object% (is|is equal to|are|=|==) %Object%");
34+
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object% (is|is equal to|are) %Object%",
35+
"%Object% ?(=|==) ?%Object%");
3536
}
3637

3738
@Override
3839
public Pattern.Match match(String thing, Context context) {
3940
if (!thing.contains(" is ")
40-
&& !thing.contains(" =")
41+
&& !thing.contains("=")
4142
&& !thing.contains(" are ")
4243
) return null;
4344
return super.match(thing, context);

src/main/java/org/byteskript/skript/lang/syntax/comparison/LT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class LT extends RelationalExpression {
3030

3131
public LT() {
32-
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object% (is less than|<) ?%Object%");
32+
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object%( is less than | ?< ?)%Object%");
3333
try {
3434
handlers.put(StandardHandlers.FIND, OperatorHandler.class.getMethod("lt", Object.class, Object.class));
3535
handlers.put(StandardHandlers.GET, OperatorHandler.class.getMethod("lt", Object.class, Object.class));

src/main/java/org/byteskript/skript/lang/syntax/comparison/LTEQ.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
public class LTEQ extends RelationalExpression {
3030

3131
public LTEQ() {
32-
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object% (is less than or equal to|<=) ?%Object%");
32+
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object%( is less than or equal to | ?<= ?)%Object%");
3333
try {
3434
handlers.put(StandardHandlers.FIND, OperatorHandler.class.getMethod("lteq", Object.class, Object.class));
3535
handlers.put(StandardHandlers.GET, OperatorHandler.class.getMethod("lteq", Object.class, Object.class));

src/main/java/org/byteskript/skript/lang/syntax/comparison/NotEqual.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@
3131
public class NotEqual extends RelationalExpression {
3232

3333
public NotEqual() {
34-
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION, "%Object% (isn't|is not|aren't|are not|≠|!=) %Object%");
34+
super(SkriptLangSpec.LIBRARY, StandardElements.EXPRESSION,
35+
"%Object% (isn't|is not|aren't|are not) %Object%",
36+
"%Object% ?(≠|!=) ?%Object%"
37+
);
3538
}
3639

3740
@Override
3841
public Pattern.Match match(String thing, Context context) {
3942
if (!thing.contains(" is")
4043
&& !thing.contains(" are")
41-
&& !thing.contains("")
42-
&& !thing.contains(" != ")
44+
&& !thing.contains("")
45+
&& !thing.contains("!=")
4346
) return null;
4447
return super.match(thing, context);
4548
}

src/main/java/org/byteskript/skript/lang/syntax/entry/JavaRelay.java

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

src/test/resources/sections.bsk

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11

2-
3-
function relay:
4-
java method target:
5-
owner: "org/byteskript/skript/test/SectionsTest"
6-
name: "blob"
7-
descriptor: "(Ljava/lang/String;)Ljava/lang/Object;"
8-
2+
function relay(thing):
3+
trigger:
4+
return "hello " + {thing}
95

106
function relay_test:
117
trigger:

0 commit comments

Comments
 (0)