Skip to content

Commit 65b14fe

Browse files
committed
Tidy up code.
1 parent 768d0e7 commit 65b14fe

Some content is hidden

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

57 files changed

+199
-219
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<dependency>
7575
<groupId>org.ow2.asm</groupId>
7676
<artifactId>asm</artifactId>
77-
<version>9.2</version>
77+
<version>9.3</version>
7878
<scope>compile</scope>
7979
</dependency>
8080
<dependency>

src/main/java/org/byteskript/skript/api/SyntaxElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ default boolean isDelay() {
112112
default boolean requiresMainThread() {
113113
return false;
114114
}*/
115-
115+
116116
@Ignore
117117
default void addSkipInstruction(Context context, Consumer<Context> consumer) {
118118
context.addSkipInstruction(consumer);

src/main/java/org/byteskript/skript/api/automatic/GeneratedEntryNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public GeneratedEntryNode(Library provider, final RecordComponent target, String
2525
super(provider, StandardElements.NODE, patterns);
2626
this.target = target;
2727
}
28-
28+
2929
@Override
3030
public Type getReturnType() {
3131
return CommonTypes.VOID;
3232
}
33-
33+
3434
@Override
3535
public void preCompile(Context context, Pattern.Match match) throws Throwable {
3636
final ElementTree tree = context.getCompileCurrent().nested()[0];

src/main/java/org/byteskript/skript/api/automatic/GeneratedEntrySection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public GeneratedEntrySection(Library provider, final Class<Record> target, Strin
3030
super(provider, StandardElements.SECTION, patterns);
3131
this.target = target;
3232
}
33-
33+
3434
@Override
3535
public Type getReturnType() {
3636
return CommonTypes.VOID;
3737
}
38-
38+
3939
@Override
4040
public void compile(Context context, Pattern.Match match) throws Throwable {
4141
context.setState(CompileState.AREA_BODY);

src/main/java/org/byteskript/skript/api/syntax/Effect.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ public abstract class Effect extends Element implements SyntaxElement {
2626
public Effect(final Library provider, final LanguageElement type, final String... patterns) {
2727
super(provider, type, patterns);
2828
}
29-
30-
@Override
31-
public Type getReturnType() {
32-
return CommonTypes.VOID;
33-
}
34-
29+
3530
@Override
3631
public CompileState getSubState() {
3732
return CompileState.STATEMENT; // looking for expressions here
@@ -42,6 +37,11 @@ public boolean allowAsInputFor(Type type) {
4237
return true; // support meta-effects
4338
}
4439

40+
@Override
41+
public Type getReturnType() {
42+
return CommonTypes.VOID;
43+
}
44+
4545
@Override
4646
public void preCompile(Context context, Pattern.Match match) throws Throwable {
4747
final Method target = handlers.get(StandardHandlers.RUN);

src/main/java/org/byteskript/skript/api/syntax/Member.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public void onSectionExit(Context context, SectionMeta meta) {
3131
context.setField(null);
3232
context.setState(CompileState.ROOT);
3333
}
34-
35-
@Override
36-
public Type getReturnType() {
37-
return CommonTypes.VOID;
38-
}
39-
34+
4035
@Override
4136
public boolean allowAsInputFor(Type type) {
4237
return false;
4338
}
4439

40+
@Override
41+
public Type getReturnType() {
42+
return CommonTypes.VOID;
43+
}
44+
4545
}

src/main/java/org/byteskript/skript/api/syntax/SectionEntry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ public SectionEntry(Library provider, LanguageElement type, String... patterns)
2323
public CompileState getSubState() {
2424
return CompileState.MEMBER_BODY;
2525
}
26-
26+
2727
@Override
2828
public Type getReturnType() {
2929
return CommonTypes.VOID;
3030
}
31-
31+
3232
@Override
3333
public boolean allowedIn(State state, Context context) {
3434
return state == CompileState.MEMBER_BODY;

src/main/java/org/byteskript/skript/api/syntax/SimpleEntry.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ public Pattern.Match match(String thing, Context context) {
2929
public CompileState getSubState() {
3030
return CompileState.MEMBER_BODY;
3131
}
32-
33-
@Override
34-
public Type getReturnType() {
35-
return CommonTypes.VOID;
36-
}
37-
32+
3833
@Override
3934
public boolean allowAsInputFor(Type type) {
4035
return false;
4136
}
4237

38+
@Override
39+
public Type getReturnType() {
40+
return CommonTypes.VOID;
41+
}
42+
4343
@Override
4444
public boolean allowedIn(State state, Context context) {
4545
return state == CompileState.MEMBER_BODY;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ public MethodErasure useHandle(String property, HandlerType type) {
359359
final List<PropertyAccessGenerator> list = this.usedProperties.get(type);
360360
boolean unused = true;
361361
for (Library library : this.libraries) {
362-
sub:
363362
for (PropertyHandler handler : library.getProperties()) {
364363
if (!handler.name().equals(property)) continue;
365364
if (!handler.type().equals(type)) continue;
@@ -389,7 +388,7 @@ public MethodErasure useHandle(String property, HandlerType type) {
389388
list.add(generator);
390389
}
391390
final Type ret = type.expectReturn() ? CommonTypes.OBJECT : new Type(void.class);
392-
final Type[] params = type.expectInputs() ? new Type[]{CommonTypes.OBJECT, CommonTypes.OBJECT} : new Type[]{CommonTypes.OBJECT};
391+
final Type[] params = type.expectInputs() ? new Type[] {CommonTypes.OBJECT, CommonTypes.OBJECT} : new Type[] {CommonTypes.OBJECT};
393392
return new MethodErasure(ret, "property_" + type.name() + "$" + property, params);
394393
}
395394

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ public ElementTree assembleStatement(final String statement, final FileContext c
228228
context.setState(handler.getSubState()); // move state change to syntax
229229
context.currentEffect = handler;
230230
details.lineMatched = handler;
231-
inner:
232231
for (int i = 0; i < types.length; i++) {
233232
final String input = inputs[i];
234233
final Type type = types[i];
@@ -268,7 +267,6 @@ public ElementTree assembleExpression(String expression, final Type expected, fi
268267
if (inputs.length < types.length) continue;
269268
context.setState(handler.getSubState()); // anticipate inner-effect state change
270269
details.expressionMatched = handler;
271-
inner:
272270
for (int i = 0; i < types.length; i++) {
273271
final String input = inputs[i];
274272
final Type type = types[i];

0 commit comments

Comments
 (0)