浏览代码

allow compilation without hscript

ncannasse 11 年之前
父节点
当前提交
90bb10173e
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      h2d/comp/Parser.hx

+ 5 - 1
h2d/comp/Parser.hx

@@ -17,18 +17,22 @@ private class CustomInterp extends hscript.Interp {
 
 class Parser {
 	
-	var comps : Map<String, haxe.xml.Fast -> Component -> Component>;
+	var comps : Map < String, haxe.xml.Fast -> Component -> Component > ;
+	#if hscript
 	var interp : hscript.Interp;
+	#end
 	var root : Component;
 	
 	public function new(?api:{}) {
 		comps = new Map();
+		#if hscript
 		interp = new CustomInterp();
 		interp.variables.set("$", function(rq) return new h2d.comp.JQuery(root, rq));
 		interp.variables.set("api", api);
 		if( api != null )
 			for( f in Reflect.fields(api) )
 				interp.variables.set(f, Reflect.field(api, f));
+		#end
 	}
 	
 	public function build( x : haxe.xml.Fast, ?parent : Component ) {