-
-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/feature' into feature/total-experience-get-xp
- Loading branch information
Showing
16 changed files
with
426 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/ch/njol/skript/lang/parser/ParseStackOverflowException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package ch.njol.skript.lang.parser; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.PrintStream; | ||
|
||
/** | ||
* An exception noting that a {@link StackOverflowError} has occurred | ||
* during Skript parsing. Contains information about the {@link ParsingStack} | ||
* from when the stack overflow occurred. | ||
*/ | ||
public class ParseStackOverflowException extends RuntimeException { | ||
|
||
protected final ParsingStack parsingStack; | ||
|
||
public ParseStackOverflowException(StackOverflowError cause, ParsingStack parsingStack) { | ||
super(createMessage(parsingStack), cause); | ||
this.parsingStack = parsingStack; | ||
} | ||
|
||
/** | ||
* Creates the exception message from the given {@link ParsingStack}. | ||
*/ | ||
private static String createMessage(ParsingStack stack) { | ||
ByteArrayOutputStream stream = new ByteArrayOutputStream(); | ||
|
||
PrintStream printStream = new PrintStream(stream); | ||
stack.print(printStream); | ||
|
||
return stream.toString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.