mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-18 19:29:08 +00:00
Added projects and basic build scripts. Project for scripting engine, API, Main 1.7 version and one for each mod supported in 1.7.
This commit is contained in:
1 parent
219106f392
commit
38b78ce305
281 files changed
+25090
-49
No files matched your search
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This file is subject to the license.txt file in the main folder
|
||||
* of this project.
|
||||
*/
|
||||
|
||||
package stanhebben.zenscript.parser;
|
||||
|
||||
import stanhebben.zenscript.ZenParsedFile;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
public class ParseException extends RuntimeException {
|
||||
private final Token token;
|
||||
private final String message;
|
||||
|
||||
public ParseException(Token token, String error) {
|
||||
super(token == null ? "Error at end of file - " + error : "Error parsing line " + token.getPosition().getLine() + ":" + token.getPosition().getLineOffset() + " - " + error + " (last token: " + token.getValue() + ")");
|
||||
|
||||
this.token = token;
|
||||
this.message = error;
|
||||
}
|
||||
|
||||
public ZenParsedFile getFile() {
|
||||
return token == null ? null : token.getPosition().getFile();
|
||||
}
|
||||
|
||||
public int getLine() {
|
||||
return token == null ? -1 : token.getPosition().getLine();
|
||||
}
|
||||
|
||||
public int getLineOffset() {
|
||||
return token == null ? -1 : token.getPosition().getLineOffset();
|
||||
}
|
||||
|
||||
public String getExplanation() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user