bshell: re-organise build into three separate components

bshell: the front-end binary
bshell.runtime: contains the parser, compiler, and classes needed to run bshell scripts
bshell.core: contains the builtin commandlets and aliases
This commit is contained in:
2026-05-25 10:33:29 +01:00
parent 58c76a1f57
commit edfb3e24a3
165 changed files with 5173 additions and 4995 deletions
+44
View File
@@ -0,0 +1,44 @@
#include <bshell/command/alias.h>
#include <bshell/command/command.h>
#include <fx/reflection/function.h>
#include <fx/string.h>
#include <fx/vector.h>
#define BSHELL_TYPE_PERCENT (bshell_percent_get_type())
fx_type_id bshell_percent_get_type(void);
FX_DECLARE_TYPE(bshell_percent);
FX_TYPE_CLASS_DECLARATION_BEGIN(bshell_percent)
FX_TYPE_CLASS_DECLARATION_END(bshell_percent)
struct bshell_percent_p {
};
static void init(fx_object *obj, void *priv)
{
}
FX_TYPE_CLASS_BEGIN(bshell_percent)
FX_TYPE_VTABLE_INTERFACE_BEGIN(fx_object, FX_TYPE_OBJECT)
FX_INTERFACE_ENTRY(to_string) = NULL;
FX_TYPE_VTABLE_INTERFACE_END(fx_object, FX_TYPE_OBJECT)
FX_TYPE_VTABLE_INTERFACE_BEGIN(bshell_alias, BSHELL_TYPE_ALIAS)
FX_INTERFACE_ENTRY(a_callable_name) = "%";
FX_INTERFACE_ENTRY(a_target_name) = "ForEach-Object";
FX_TYPE_VTABLE_INTERFACE_END(bshell_cmdlet, BSHELL_TYPE_CMDLET)
FX_TYPE_VTABLE_INTERFACE_BEGIN(bshell_command, BSHELL_TYPE_COMMAND)
FX_TYPE_VTABLE_INTERFACE_END(bshell_command, BSHELL_TYPE_COMMAND)
FX_TYPE_CLASS_END(bshell_percent)
FX_TYPE_DEFINITION_BEGIN(bshell_percent)
FX_TYPE_ID(0x4255a9de, 0xd6f6, 0x4708, 0x829c, 0xffa4c6034edb);
FX_TYPE_NAME("bshell.core.percent");
FX_TYPE_EXTENDS(BSHELL_TYPE_ALIAS);
FX_TYPE_CLASS(bshell_percent_class);
FX_TYPE_INSTANCE_INIT(init);
FX_TYPE_INSTANCE_PRIVATE(struct bshell_percent_p);
FX_TYPE_DEFINITION_END(bshell_percent)