diff src/luan/modules/parsers/ParseException.java @ 1110:38a42f437fd2

queryparser now uses parsers.Parser
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 02 Aug 2017 13:45:06 -0600
parents 1a68fc55a80c
children
line wrap: on
line diff
--- a/src/luan/modules/parsers/ParseException.java	Wed Aug 02 12:36:28 2017 -0600
+++ b/src/luan/modules/parsers/ParseException.java	Wed Aug 02 13:45:06 2017 -0600
@@ -6,13 +6,24 @@
 	public final int errorIndex;
 	public final int highIndex;
 
-	ParseException(Parser parser,String msg) {
+	public ParseException(Parser parser,String msg) {
 		super(msg);
 		this.text = parser.text;
 		this.errorIndex = parser.currentIndex();
 		this.highIndex = parser.highIndex();
 	}
 
+	public ParseException(Parser parser,Exception cause) {
+		this(parser,cause.getMessage(),cause);
+	}
+
+	public ParseException(Parser parser,String msg,Exception cause) {
+		super(msg,cause);
+		this.text = parser.text;
+		this.errorIndex = parser.currentIndex();
+		this.highIndex = parser.highIndex();
+	}
+
 	private class Location {
 		final int line;
 		final int pos;