From 5b6576c5241758eafd6af659bc4cbc36077d3c24 Mon Sep 17 00:00:00 2001 From: Hyper_ <40342021+NotHyper-474@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:11:59 -0300 Subject: [PATCH] Add `hscript` redirectives that can be enabled with a compile flag. --- hscript/Async.hx | 5 +++++ hscript/Checker.hx | 5 +++++ hscript/Expr.hx | 8 ++++++++ hscript/Interp.hx | 5 +++++ hscript/Parser.hx | 5 +++++ hscript/Printer.hx | 5 +++++ hscript/README.md | 9 +++++++++ hscript/Tools.hx | 5 +++++ include.xml | 5 ++++- 9 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 hscript/Async.hx create mode 100644 hscript/Checker.hx create mode 100644 hscript/Expr.hx create mode 100644 hscript/Interp.hx create mode 100644 hscript/Parser.hx create mode 100644 hscript/Printer.hx create mode 100644 hscript/README.md create mode 100644 hscript/Tools.hx diff --git a/hscript/Async.hx b/hscript/Async.hx new file mode 100644 index 00000000..83b34247 --- /dev/null +++ b/hscript/Async.hx @@ -0,0 +1,5 @@ +package hscript; + +#if POLYMOD_REDIRECT_HSCRIPT +typedef Async = polymod.hscript._internal.Async; +#end diff --git a/hscript/Checker.hx b/hscript/Checker.hx new file mode 100644 index 00000000..e0dc33e6 --- /dev/null +++ b/hscript/Checker.hx @@ -0,0 +1,5 @@ +package hscript; + +#if POLYMOD_REDIRECT_HSCRIPT +typedef Checker = polymod.hscript._internal.Checker; +#end diff --git a/hscript/Expr.hx b/hscript/Expr.hx new file mode 100644 index 00000000..fbe56a9f --- /dev/null +++ b/hscript/Expr.hx @@ -0,0 +1,8 @@ +package hscript; + +#if POLYMOD_REDIRECT_HSCRIPT +typedef Expr = polymod.hscript._internal.Expr; +typedef ExprDef = polymod.hscript._internal.Expr.ExprDef; +typedef Error = polymod.hscript._internal.Expr.Error; +typedef ErrorDef = polymod.hscript._internal.Expr.ErrorDef; +#end diff --git a/hscript/Interp.hx b/hscript/Interp.hx new file mode 100644 index 00000000..bf122a8c --- /dev/null +++ b/hscript/Interp.hx @@ -0,0 +1,5 @@ +package hscript; + +#if POLYMOD_REDIRECT_HSCRIPT +typedef Interp = polymod.hscript._internal.Interp; +#end diff --git a/hscript/Parser.hx b/hscript/Parser.hx new file mode 100644 index 00000000..f1fb48fa --- /dev/null +++ b/hscript/Parser.hx @@ -0,0 +1,5 @@ +package hscript; + +#if POLYMOD_REDIRECT_HSCRIPT +typedef Parser = polymod.hscript._internal.Parser; +#end diff --git a/hscript/Printer.hx b/hscript/Printer.hx new file mode 100644 index 00000000..e4d06070 --- /dev/null +++ b/hscript/Printer.hx @@ -0,0 +1,5 @@ +package hscript; + +#if POLYMOD_REDIRECT_HSCRIPT +typedef Printer = polymod.hscript._internal.Printer; +#end diff --git a/hscript/README.md b/hscript/README.md new file mode 100644 index 00000000..663436f4 --- /dev/null +++ b/hscript/README.md @@ -0,0 +1,9 @@ +## What are these? + +These files mean to redirect imports of HScript modules to Polymod ones, so that projects which depend on HScript don't have to keep an extra library lying around. +Keep in mind that compatibility with existing code is not guaranteed due to Polymod-specific changes. + +## How to use them? + +Simply add the `POLYMOD_REDIRECT_HSCRIPT` define to your project. You should be able to import the typedefs. +Do note that not all types are available, only essential ones. diff --git a/hscript/Tools.hx b/hscript/Tools.hx new file mode 100644 index 00000000..c59b255d --- /dev/null +++ b/hscript/Tools.hx @@ -0,0 +1,5 @@ +package hscript; + +#if POLYMOD_REDIRECT_HSCRIPT +typedef Tools = polymod.hscript._internal.Tools; +#end diff --git a/include.xml b/include.xml index e28dae2b..60307d01 100644 --- a/include.xml +++ b/include.xml @@ -2,7 +2,10 @@ - +
+ + +