From f4bc4570be7a51b00bf44d5bd4be99108dd94a30 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 6 Oct 2022 12:26:42 -0400 Subject: Libtnsl additions --- libtnsl/reflect/_type.tnsl | 71 ++++++++++++++++++++++++++++++++++++++++++++ libtnsl/reflect/reflect.tnsl | 2 +- libtnsl/reflect/type.tnsl | 71 -------------------------------------------- 3 files changed, 72 insertions(+), 72 deletions(-) create mode 100644 libtnsl/reflect/_type.tnsl delete mode 100644 libtnsl/reflect/type.tnsl (limited to 'libtnsl/reflect') diff --git a/libtnsl/reflect/_type.tnsl b/libtnsl/reflect/_type.tnsl new file mode 100644 index 0000000..7a19b7d --- /dev/null +++ b/libtnsl/reflect/_type.tnsl @@ -0,0 +1,71 @@ +/## + Copyright 2021 Kyle Gunger + + Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. + + This file may only be used in accordance with one of the two + licenses. You should have received a copy of each license with + the source code. In the event that you did not recieve a copy + of the licenses, they may be found at the following URLs: + + CDDL 1.0: + https://opensource.org/licenses/CDDL-1.0 + + BSD 3-Clause: + https://opensource.org/licenses/BSD-3-Clause + + THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO + WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE + EXPRESS OR IMPLIED +#/ + +/## tnsl.reflect._type + Header data which non-raw structs point to. + Upper limits for classes and libs defined here: + - Max 2^16 libraries + - Max 2^16 modules/sub-modules per library + - Max 2^16 classes per module + - Max 2^8 Generics per class +#/ +; raw struct _type() { + uint16 + _library_id, + _module_id, + _type_id, + + {uint8}_type + _generics +} + +/## tnsl.reflect._type_addresses + Metadata about where things are stored + in a class +#/ +; raw struct _type_addresses { + ~{}_type + _supers, + + ~{}uint + _super_offsets, + + ~{}_method + _methods, + + ~{}_member + _members +} + +/; method _type + + /; _is (_type base) [bool] + ;/ + + /; inline _get (_type t, ~void s, _member m) [~void] + ;/ + + /; inline raw _call (_type t, ~void s, _method m, ~void p) + ;/ + + /; _offset (_type cast) [uint] + ;/ +;/ \ No newline at end of file diff --git a/libtnsl/reflect/reflect.tnsl b/libtnsl/reflect/reflect.tnsl index b3640c2..a438a03 100644 --- a/libtnsl/reflect/reflect.tnsl +++ b/libtnsl/reflect/reflect.tnsl @@ -25,7 +25,7 @@ #; export module reflect /: import - "type.tnsl" + "_type.tnsl" "virtual.tnsl" "resolver.tnsl" "dispatch.tnsl" diff --git a/libtnsl/reflect/type.tnsl b/libtnsl/reflect/type.tnsl deleted file mode 100644 index 7a19b7d..0000000 --- a/libtnsl/reflect/type.tnsl +++ /dev/null @@ -1,71 +0,0 @@ -/## - Copyright 2021 Kyle Gunger - - Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses. - - This file may only be used in accordance with one of the two - licenses. You should have received a copy of each license with - the source code. In the event that you did not recieve a copy - of the licenses, they may be found at the following URLs: - - CDDL 1.0: - https://opensource.org/licenses/CDDL-1.0 - - BSD 3-Clause: - https://opensource.org/licenses/BSD-3-Clause - - THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO - WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE - EXPRESS OR IMPLIED -#/ - -/## tnsl.reflect._type - Header data which non-raw structs point to. - Upper limits for classes and libs defined here: - - Max 2^16 libraries - - Max 2^16 modules/sub-modules per library - - Max 2^16 classes per module - - Max 2^8 Generics per class -#/ -; raw struct _type() { - uint16 - _library_id, - _module_id, - _type_id, - - {uint8}_type - _generics -} - -/## tnsl.reflect._type_addresses - Metadata about where things are stored - in a class -#/ -; raw struct _type_addresses { - ~{}_type - _supers, - - ~{}uint - _super_offsets, - - ~{}_method - _methods, - - ~{}_member - _members -} - -/; method _type - - /; _is (_type base) [bool] - ;/ - - /; inline _get (_type t, ~void s, _member m) [~void] - ;/ - - /; inline raw _call (_type t, ~void s, _method m, ~void p) - ;/ - - /; _offset (_type cast) [uint] - ;/ -;/ \ No newline at end of file -- cgit v1.2.3