From 1bfe81cfac8269bb225b65533371b09e350ca40f Mon Sep 17 00:00:00 2001 From: Jaime Humberto Macias Bustamante Date: Fri, 30 May 2025 22:05:54 -0700 Subject: [PATCH] Simplified Interfaces - Part 1 here we go again... --- .gitignore | 2 +- extraParams.hxml | 2 +- hscript/CustomClassHandler.hx | 3 ++- hscript/IHScriptCustomAccessBehaviour.hx | 5 +---- hscript/IHScriptCustomClassBehaviour.hx | 9 +-------- hscript/macros/{UsingHandler.hx => AbstractHandler.hx} | 2 +- 6 files changed, 7 insertions(+), 16 deletions(-) rename hscript/macros/{UsingHandler.hx => AbstractHandler.hx} (99%) diff --git a/.gitignore b/.gitignore index 68ab983..8c29a0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /hscript.swf /release.zip - +dump/* tests/bin/* \ No newline at end of file diff --git a/extraParams.hxml b/extraParams.hxml index 18d9021..28863b1 100644 --- a/extraParams.hxml +++ b/extraParams.hxml @@ -1,3 +1,3 @@ --macro keep('IntIterator') ---macro hscript.macros.UsingHandler.init() +--macro hscript.macros.AbstractHandler.init() --macro hscript.macros.ClassExtendMacro.init() diff --git a/hscript/CustomClassHandler.hx b/hscript/CustomClassHandler.hx index 10b399c..ee2e593 100644 --- a/hscript/CustomClassHandler.hx +++ b/hscript/CustomClassHandler.hx @@ -4,6 +4,7 @@ import hscript.Interp.DeclaredVar; import hscript.utils.UnsafeReflect; using StringTools; +// BIG TODO: revamp this class CustomClassHandler implements IHScriptCustomConstructor { public static var staticHandler = new StaticHandler(); @@ -153,7 +154,7 @@ class CustomClassHandler implements IHScriptCustomConstructor { } } -class CustomTemplateClass implements IHScriptCustomClassBehaviour implements IHScriptCustomAccessBehaviour { +class CustomTemplateClass implements IHScriptCustomClassBehaviour { public var __interp:Interp; public var __allowSetGet:Bool = true; public var __custom__variables:Map; diff --git a/hscript/IHScriptCustomAccessBehaviour.hx b/hscript/IHScriptCustomAccessBehaviour.hx index 12e982a..363d9fe 100644 --- a/hscript/IHScriptCustomAccessBehaviour.hx +++ b/hscript/IHScriptCustomAccessBehaviour.hx @@ -1,11 +1,8 @@ package hscript; -interface IHScriptCustomAccessBehaviour { +interface IHScriptCustomAccessBehaviour extends IHScriptCustomBehaviour { var __allowSetGet:Bool; - public function hset(name:String, val:Dynamic):Dynamic; - public function hget(name:String):Dynamic; - public function __callGetter(name:String):Dynamic; public function __callSetter(name:String, val:Dynamic):Dynamic; } \ No newline at end of file diff --git a/hscript/IHScriptCustomClassBehaviour.hx b/hscript/IHScriptCustomClassBehaviour.hx index 11d24fd..c8ee98a 100644 --- a/hscript/IHScriptCustomClassBehaviour.hx +++ b/hscript/IHScriptCustomClassBehaviour.hx @@ -1,16 +1,9 @@ package hscript; -interface IHScriptCustomClassBehaviour { +interface IHScriptCustomClassBehaviour extends IHScriptCustomAccessBehaviour{ public var __interp:Interp; public var __custom__variables:Map; - public var __allowSetGet:Bool; public var __real_fields:Array; public var __class__fields:Array; - public function hset(name:String, val:Dynamic):Dynamic; - public function hget(name:String):Dynamic; - - public function __callGetter(name:String):Dynamic; - - public function __callSetter(name:String, val:Dynamic):Dynamic; } \ No newline at end of file diff --git a/hscript/macros/UsingHandler.hx b/hscript/macros/AbstractHandler.hx similarity index 99% rename from hscript/macros/UsingHandler.hx rename to hscript/macros/AbstractHandler.hx index a85825c..99bd540 100644 --- a/hscript/macros/UsingHandler.hx +++ b/hscript/macros/AbstractHandler.hx @@ -10,7 +10,7 @@ import haxe.macro.Compiler; using StringTools; -class UsingHandler { +class AbstractHandler { public static function init() { #if !display if(Context.defined("display")) return;