Skip to content

Commit e1f1331

Browse files
KoloInDaCriblemz1
authored andcommitted
lock some stuff
there's some compilation errors in some classes if a library isn't available and polymod is the only thing that's in a project
1 parent 989b2b8 commit e1f1331

6 files changed

Lines changed: 15 additions & 6 deletions

File tree

polymod/hscript/_internal/PolymodClassDeclEx.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package polymod.hscript._internal;
22

3+
#if hscript
34
import hscript.Expr.ClassDecl;
45
import hscript.Expr.FieldDecl;
56
import polymod.hscript._internal.PolymodScriptClass;
@@ -30,4 +31,4 @@ typedef PolymodClassImport = {
3031
@:optional var cls:Class<Dynamic>;
3132
@:optional var enm:Enum<Dynamic>;
3233
}
33-
34+
#end

polymod/hscript/_internal/PolymodExprEx.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package polymod.hscript._internal;
22

3+
#if hscript
34
#if hscriptPos
45
class ErrorEx
56
{
@@ -132,3 +133,4 @@ ECustom(msg:String);
132133
throw "Unimplemented error type " + err;
133134
}
134135
}
136+
#end

polymod/hscript/_internal/PolymodPrinterEx.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package polymod.hscript._internal;
22

3+
#if hscript
34
import hscript.Printer;
45

56
class PolymodPrinterEx extends Printer
@@ -37,3 +38,4 @@ class PolymodPrinterEx extends Printer
3738
#end
3839
}
3940
}
41+
#end

polymod/hscript/_internal/PolymodScriptClass.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package polymod.hscript._internal;
22

3+
#if hscript
34
import hscript.Expr;
45
import polymod.hscript._internal.PolymodExprEx;
56

@@ -558,3 +559,4 @@ class PolymodScriptClass
558559
}
559560
#end
560561
}
562+
#end

polymod/hscript/_internal/PolymodScriptMacro.hx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package polymod.hscript._internal;
22

3+
#if hscript
34
import EReg;
45
import haxe.macro.Context;
56
import haxe.macro.Expr;
@@ -84,10 +85,6 @@ class PolymodScriptMacro
8485
static var scriptOverrides:Array<Expr> = [];
8586
public static function buildScriptImpls(?filters:Array<String>):Void
8687
{
87-
#if !hscript
88-
return;
89-
#end
90-
9188
// if no filters are given
9289
// create a scripted implementation
9390
// for every class
@@ -588,3 +585,4 @@ class PolymodScriptMacro
588585
return scriptOverrides;
589586
}
590587
}
588+
#end

polymod/hscript/_internal/PolymodScriptManager.hx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package polymod.hscript._internal;
22

3+
#if hscript
34
import hscript.Expr;
45
import polymod.hscript._internal.PolymodClassDeclEx;
56

@@ -102,6 +103,7 @@ class PolymodScriptManager
102103
}
103104
}
104105

106+
#if lime
105107
public function registerScriptClassByPathAsync(path:String):lime.app.Future<Bool>
106108
{
107109
var promise = new lime.app.Promise<Bool>();
@@ -154,6 +156,7 @@ class PolymodScriptManager
154156
// Await the promise
155157
return promise.future;
156158
}
159+
#end
157160

158161
public function validateImports():Void
159162
{
@@ -547,4 +550,5 @@ class PolymodScriptManager
547550
return staticCallFunction(path, fnName, [arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7]);
548551
}
549552
#end
550-
}
553+
}
554+
#end

0 commit comments

Comments
 (0)