Skip to content

Commit 5ba42a2

Browse files
committed
Split errors into correct messages.
1 parent 873abbc commit 5ba42a2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,11 @@ public ElementTree assembleStatement(final String statement, final FileContext c
241241
current = new ElementTree(handler, match, elements.toArray(new ElementTree[0]));
242242
break;
243243
}
244-
if (current == null)
245-
throw new ScriptParseError(context.lineNumber(), details.clone(), "No syntax match found for statement '" + statement + "'", null);
244+
if (current == null) {
245+
if (details.expression != null)
246+
throw new ScriptParseError(context.lineNumber(), details.clone(), "No syntax match found for expression '" + details.expression + "'", null);
247+
else throw new ScriptParseError(context.lineNumber(), details.clone(), "No syntax match found for statement '" + statement + "'", null);
248+
}
246249
return current;
247250
}
248251

src/main/java/org/byteskript/skript/runtime/Skript.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,6 @@ public Script loadScript(final File source, final String name)
989989
}
990990

991991
//region Output
992-
993992
/**
994993
* Set the current print stream used by the `print` effect.
995994
* This can be used to redirect output in a particular state.

0 commit comments

Comments
 (0)