From ad516054002b4105197ef4fc37ac380cdf680750 Mon Sep 17 00:00:00 2001 From: nodist Date: Fri, 26 Jun 2026 15:56:39 -0400 Subject: change how vars are identified --- docs/application/identifier.md | 17 +++++++++++++++++ docs/application/index.md | 18 +++++++++--------- docs/application/shared.md | 2 +- docs/application/type.md | 7 ++++--- 4 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 docs/application/identifier.md (limited to 'docs/application') diff --git a/docs/application/identifier.md b/docs/application/identifier.md new file mode 100644 index 0000000..3195955 --- /dev/null +++ b/docs/application/identifier.md @@ -0,0 +1,17 @@ +# Identifier + +--- + +Store vars, types and symbols as compressed strings + +## Object Definitions + +```c +#define KPL_IDENTIFIER_PARTS 10 + +// TODO 100 charaters of [A-Za-z0-9_] in 80 bytes + +typedef struct { + uint64_t parts[KPL_IDENTIFIER_PARTS]; +} kpl_identifier; +``` diff --git a/docs/application/index.md b/docs/application/index.md index f8fe293..279ff6c 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -16,6 +16,7 @@ * ##### [Memory](./memory.md) * ##### [Io](./io.md) * ##### [Shared](./shared.md) +* ##### [Identifier](./identifier.md) * ##### [Type](./type.md) * ##### [Group](./group.md) * ##### [Buffer](./buffer.md) @@ -41,14 +42,13 @@ 1. ##### [Register](../lifecycle/register.md) 2. ##### [Parse](../lifecycle/parse.md) -3. ##### [Scan](../lifecycle/scan.md) -4. ##### Scope -5. ##### Import -6. ##### Check -7. ##### Eval -8. ##### Ir -9. ##### Jit -10. ##### Exec -11. ##### Notify +3. ##### Scan +4. ##### Import +5. ##### Check +6. ##### Eval +7. ##### Ir +8. ##### Jit +9. ##### Exec +10. ##### Notify ## Shutdown diff --git a/docs/application/shared.md b/docs/application/shared.md index e68b590..0990ae6 100644 --- a/docs/application/shared.md +++ b/docs/application/shared.md @@ -2,7 +2,7 @@ --- -## Object Definition +## Object Definitions ```c typedef struct _kpl_shared { diff --git a/docs/application/type.md b/docs/application/type.md index 5377cf6..e6adc81 100644 --- a/docs/application/type.md +++ b/docs/application/type.md @@ -17,17 +17,18 @@ typedef enum { } kpl_type_qualifiers; typedef union { - // ... + // 96 Bytes Max } kpl_type_body; typedef struct { kpl_type_template template; uint8_t qualifiers; uint16_t modifiers; + kpl_ptr self; + uint32_t token_position, token_length; + int32_t id; _Atomic int32_t ref_count; kpl_namespace_module *module; - uint32_t token_line, token_position, token_length; - kpl_ptr self; kpl_type_body body; } kpl_type; -- cgit v1.2.3