changeset 80:851e356101c1

add LuanElement.COMPILER git-svn-id: https://luan-java.googlecode.com/svn/trunk@81 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Fri, 15 Feb 2013 23:59:32 +0000
parents 805929c3c6e1
children 9df729fa4419
files src/luan/LuanElement.java src/luan/interp/LuanCompiler.java
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/LuanElement.java	Fri Feb 15 23:12:15 2013 +0000
+++ b/src/luan/LuanElement.java	Fri Feb 15 23:59:32 2013 +0000
@@ -14,4 +14,10 @@
 			return "Java";
 		}
 	};
+
+	public static final LuanElement COMPILER = new LuanElement(){
+		@Override String location() {
+			return "Compiler";
+		}
+	};
 }
--- a/src/luan/interp/LuanCompiler.java	Fri Feb 15 23:12:15 2013 +0000
+++ b/src/luan/interp/LuanCompiler.java	Fri Feb 15 23:59:32 2013 +0000
@@ -21,7 +21,7 @@
 		ParsingResult<?> result = new ReportingParseRunner(parser.Target()).run(src.text);
 //		ParsingResult<?> result = new TracingParseRunner(parser.Target()).run(src);
 		if( result.hasErrors() )
-			throw new LuanException( luan, null, ErrorUtils.printParseErrors(result) );
+			throw new LuanException( luan, LuanElement.COMPILER, ErrorUtils.printParseErrors(result) );
 		Chunk chunk = (Chunk)result.resultValue;
 		return new Closure((LuanStateImpl)luan,chunk);
 	}