From 4c008d258f6fd23fd64e2a6b059448748d7f7d24 Mon Sep 17 00:00:00 2001 From: nodist Date: Mon, 13 Jul 2026 17:02:34 -0400 Subject: every type has access to its parent --- docs/application/error.md | 18 ++++++++++++++++-- docs/application/namespace.md | 2 +- docs/application/thread.md | 2 +- docs/application/type.md | 12 +++++++----- docs/lifecycle/check.md | 6 +++--- docs/lifecycle/eval.md | 4 ++++ docs/lifecycle/exec.md | 2 ++ docs/lifecycle/ir.md | 8 +++++++- docs/lifecycle/jit.md | 10 +++++----- docs/lifecycle/notify.md | 2 ++ docs/lifecycle/parse.md | 2 -- docs/lifecycle/scope.md | 4 ++-- docs/type_system/ir.md | 5 +++-- docs/type_system/list.md | 4 ++-- 14 files changed, 55 insertions(+), 26 deletions(-) (limited to 'docs') diff --git a/docs/application/error.md b/docs/application/error.md index f0d844a..2e1e703 100644 --- a/docs/application/error.md +++ b/docs/application/error.md @@ -5,9 +5,23 @@ ## Object Definitions ```c +typedef union : uin16_t { + ERROR_C = 1 << 0, + ERROR_TOKEN = 1 << 1, + ERROR_TYPE = 1 << 2 +} kpl_error_flags; + typedef struct _kpl_error { - int32_t line; - char *file, *function; + uint16_t line, flags; + uin32_t class_options; + struct _kpl_error *stack; + union { + struct { + char *file, char *function; + } c; + kpl_token token; + kpl_type *type; + } source; kpl_class class; } kpl_error; ``` diff --git a/docs/application/namespace.md b/docs/application/namespace.md index f8653f7..e9842cd 100644 --- a/docs/application/namespace.md +++ b/docs/application/namespace.md @@ -32,7 +32,7 @@ typedef struct _kpl_namespace_module { static kpl_namespace_module *namespace_module_tree; -kpl_mutex namespace_modul_tree_mutex; +kpl_mutex namespace_module_tree_mutex; static kpl_namespace_module namespace_string; diff --git a/docs/application/thread.md b/docs/application/thread.md index e5b3981..c0ad199 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -35,7 +35,7 @@ typedef struct { typedef struct { kpl_task_queue queue; - _Atomic size_t priority; + _Atomic ssize_t priority; sem_t counter; pthread_t thread; } kpl_thread; diff --git a/docs/application/type.md b/docs/application/type.md index 793fb14..f028fba 100644 --- a/docs/application/type.md +++ b/docs/application/type.md @@ -21,21 +21,23 @@ typedef union { // 64 Bytes Max } kpl_type_body; +typedef struct { + uint16_t length, line; + int32_t position, module_id; +} kpl_token; + typedef struct _kpl_type { kpl_type_template template; uint8_t qualifiers; uint16_t modifiers; union { - struct { - uint16_t length, line; - uint32_t position, module_id; - } token; + kpl_token token; struct { int32_t id, tree_weight; } var; } meta; _Atomic ssize_t ref_count; - struct _kpl_type *prev, *next; + struct _kpl_type *prev, *next, *parent; kpl_type_body body; } kpl_type; ``` diff --git a/docs/lifecycle/check.md b/docs/lifecycle/check.md index 358106d..f556230 100644 --- a/docs/lifecycle/check.md +++ b/docs/lifecycle/check.md @@ -4,8 +4,8 @@ Type checking -# Ops +## Ops -# Actions +## Actions -# Functions +## Functions diff --git a/docs/lifecycle/eval.md b/docs/lifecycle/eval.md index 11081a6..659fa1e 100644 --- a/docs/lifecycle/eval.md +++ b/docs/lifecycle/eval.md @@ -3,3 +3,7 @@ --- Reduce AST size by evaluating expressions + +## Constant Expressions + +## Type Operations diff --git a/docs/lifecycle/exec.md b/docs/lifecycle/exec.md index edab443..bd2012c 100644 --- a/docs/lifecycle/exec.md +++ b/docs/lifecycle/exec.md @@ -1,3 +1,5 @@ # Exec --- + +## Exports diff --git a/docs/lifecycle/ir.md b/docs/lifecycle/ir.md index 5db8091..1d63ce0 100644 --- a/docs/lifecycle/ir.md +++ b/docs/lifecycle/ir.md @@ -2,4 +2,10 @@ --- -Convert an AST into a list of 3 address instructions +Convert an AST into a list of 6 address instructions + +# Process + +## Tasks + +# Native Functions diff --git a/docs/lifecycle/jit.md b/docs/lifecycle/jit.md index 3243385..3ff7079 100644 --- a/docs/lifecycle/jit.md +++ b/docs/lifecycle/jit.md @@ -6,15 +6,15 @@ Convert Ir Into X64 (X86_64) ## Limitations -#### No Segmentation Registers +### No Segmentation Registers -#### No X87 Support +### No X87 Support -#### No access to the upper 8 bits of the lower 16 bits of registers AX, BX, CX, DX +### No access to the upper 8 bits of the lower 16 bits of registers AX, BX, CX, DX ## Required Implicit Registers -Instructions that implicitly modify a register now require the register as an operation +Instructions that implicitly modify a register now require the register as an argument # Operation @@ -30,7 +30,7 @@ Each instruction is written with varardic c functions with `TYPE`, `DATA` syntax ### General Register Id -### General Register Memory Displacement +### General Register Memory Offset ### XMM Registers diff --git a/docs/lifecycle/notify.md b/docs/lifecycle/notify.md index 2db3b27..4c53254 100644 --- a/docs/lifecycle/notify.md +++ b/docs/lifecycle/notify.md @@ -1,3 +1,5 @@ # Notify --- + +## Release Export Mutex diff --git a/docs/lifecycle/parse.md b/docs/lifecycle/parse.md index 4bfa6ba..6d702a8 100644 --- a/docs/lifecycle/parse.md +++ b/docs/lifecycle/parse.md @@ -35,5 +35,3 @@ On type completion look up if type is a builtin ## Define `[]` ## Action `{}` - -# Operation diff --git a/docs/lifecycle/scope.md b/docs/lifecycle/scope.md index 37ca355..64cf55b 100644 --- a/docs/lifecycle/scope.md +++ b/docs/lifecycle/scope.md @@ -2,14 +2,14 @@ --- -Traverse AST and: - ## Link Parent Lists ## Create Vars ## Initialize Functions +## Initialize Actions + ## Split Process Into Tasks by `await` ## Register Imports diff --git a/docs/type_system/ir.md b/docs/type_system/ir.md index 77c6139..4b9ea44 100644 --- a/docs/type_system/ir.md +++ b/docs/type_system/ir.md @@ -3,7 +3,7 @@ --- ```text -Ir[[IR_NAME] Address[3]] +Ir[[IR_NAME] Address[6]] ``` `IR_NAME` is a single value @@ -12,6 +12,7 @@ Ir[[IR_NAME] Address[3]] ```c typedef struct { - kpl_type *address[3]; + ssize_t label; + kpl_type *address[6]; } kpl_type_body_ir; ``` diff --git a/docs/type_system/list.md b/docs/type_system/list.md index 518727e..22ad03c 100644 --- a/docs/type_system/list.md +++ b/docs/type_system/list.md @@ -3,13 +3,13 @@ --- ```text -List[[ROOT | STATEMENT | DEFINE | ACTION | LOOP | IF | MATCH | MUTATION] PARENT; TARGET; ARG; LOOP; VAR_TREE; Collection[LIST; TYPE]] +List[[STATEMENT | DEFINE | ACTION | LOOP | IF | MATCH | MUTATION] PARENT; TARGET; ARG; LOOP; VAR_TREE; Collection[LIST; TYPE]] ``` ## Type Body Object Definitions ```c typedef struct { - kpl_type *parent, *target, *defined, *named, *var_tree, *statement_list; + kpl_type *target, *defined, *named, *var_tree, *statement_list; } kpl_type_body_list; ``` -- cgit v1.2.3