diff options
Diffstat (limited to 'docs/type_system')
| -rw-r--r-- | docs/type_system/buffer.md | 4 | ||||
| -rw-r--r-- | docs/type_system/function.md | 4 | ||||
| -rw-r--r-- | docs/type_system/group.md | 9 | ||||
| -rw-r--r-- | docs/type_system/index.md | 10 | ||||
| -rw-r--r-- | docs/type_system/list.md | 2 | ||||
| -rw-r--r-- | docs/type_system/name.md | 2 | ||||
| -rw-r--r-- | docs/type_system/overload.md | 2 | ||||
| -rw-r--r-- | docs/type_system/select.md | 6 | ||||
| -rw-r--r-- | docs/type_system/symbol.md | 2 | ||||
| -rw-r--r-- | docs/type_system/union.md | 4 | ||||
| -rw-r--r-- | docs/type_system/var.md | 12 |
11 files changed, 38 insertions, 19 deletions
diff --git a/docs/type_system/buffer.md b/docs/type_system/buffer.md index bb863a2..983fd4a 100644 --- a/docs/type_system/buffer.md +++ b/docs/type_system/buffer.md @@ -18,12 +18,14 @@ Array[Generic.T] `alias Buffer[[TYPE] Generic.T] # Operators -## ``length` +## Symbol Access ## ``get` ## ``set` +## ``length` + ## ``push` ## ``pop` diff --git a/docs/type_system/function.md b/docs/type_system/function.md index baf7337..f6a1f4f 100644 --- a/docs/type_system/function.md +++ b/docs/type_system/function.md @@ -11,13 +11,13 @@ STATEFUL : TASK | ITERATOR | CLOSURE | BOUND | REGEX FLAGS : INVOCATION | STATELESS | STATEFUL -Function[[FLAGS]; STATE; List; RETURN_TYPE; Collection[TYPE.SYMBOL]] +Function[[FLAGS]; STATE; List; RETURN_TYPE; Collection[VAR_TREE; TYPE.SYMBOL]] ``` # Alias ```text -Fn[Generic.T; Collection[TYPE.SYMBOL]] `alias Function[[FLAGS]; STATE; List; Generic.T; Collection[TYPE.SYMBOL]] +Fn[Generic.T; Collection[VAR_TREE; TYPE.SYMBOL]] `alias Function[[FLAGS]; STATE; List; Generic.T; Collection[VAR_TREE; TYPE.SYMBOL]] ``` # Inline Definition diff --git a/docs/type_system/group.md b/docs/type_system/group.md index 83fb4a5..d9c2d2d 100644 --- a/docs/type_system/group.md +++ b/docs/type_system/group.md @@ -5,19 +5,21 @@ A sequence of different types accessed by index or a symbol mapped to an index ```text -Group[[INDEX | SYMBOL] Collection[TYPE.SYMBOL]] +Group[[INDEX | SYMBOL] Collection[VAR_TREE; TYPE.SYMBOL]] ``` # Alias ```text -Tuple[Collection[TYPE.SYMBOL]] `alias Group[[INDEX] Collection[TYPE.SYMBOL]] +Tuple[Collection[TYPE.SYMBOL]] `alias Group[[INDEX] Collection[VAR_TREE; TYPE.SYMBOL]] -Table[Collection[TYPE.SYMBOL]] `alias Group[[SYMBOL] Collection[TYPE.SYMBOL]] +Table[Collection[TYPE.SYMBOL]] `alias Group[[SYMBOL] Collection[VAR_TREE; TYPE.SYMBOL]] ``` # Operators +## Symbol Access + ## ``get` ## ``set` @@ -27,6 +29,7 @@ Result[Void] : target `set (KEY; VALUE) items : Tuple $ (1; 2; 3) items `set (0; 4) +// ^ items.0 {[i] i : 4 } `log items // Tuple[I64; I64; I64] $ (4; 2; 3) ``` diff --git a/docs/type_system/index.md b/docs/type_system/index.md index 07b9c69..4c2fe73 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -42,16 +42,22 @@ A template by name only expands to all inner fields as `Any` Generic for alias and unique types, type is replaced with type passed -## Collection[TYPE] +## Collection[STORAGE; TYPE] A list of types with shape of TYPE, only can have one collection per type +The collection is stored internally as STORAGE + If using a collection the Collection[TYPE] must be the last type on the templates type list ## Void Denotes that a field that does not resolve to anything +## Identifier Templates + +* #### [Var](./var.md) + ## Value Templates * #### [Select](./select.md) @@ -102,8 +108,6 @@ Denotes that a field that does not resolve to anything * #### [Op](./op.md) -* #### [Var](./var.md) - * #### [List](./list.md) * #### [Lock](./lock.md) diff --git a/docs/type_system/list.md b/docs/type_system/list.md index be4a004..f14a06e 100644 --- a/docs/type_system/list.md +++ b/docs/type_system/list.md @@ -3,5 +3,5 @@ --- ```text -List[[STATEMENT | DEFINE | ACTION | LOOP | IF | MATCH | MUTATION] Parent; VAR_TREE; TARGET; STATEMENTS ...] +List[[ROOT | STATEMENT | DEFINE | ACTION | LOOP | IF | MATCH | MUTATION] Parent; VAR_TREE; TARGET; STATEMENTS ...] ``` diff --git a/docs/type_system/name.md b/docs/type_system/name.md index 1faeb3c..27bb784 100644 --- a/docs/type_system/name.md +++ b/docs/type_system/name.md @@ -3,5 +3,5 @@ --- ```text -Name[[UNKNOWN | IS_TYPE | ALIAS_TYPE | UNIQUE_TYPE] TYPE] +Name[[UNKNOWN | IS_TYPE | ALIAS_TYPE | UNIQUE_TYPE] TYPE; IDENTIFIER] ``` diff --git a/docs/type_system/overload.md b/docs/type_system/overload.md index 602871f..8e02054 100644 --- a/docs/type_system/overload.md +++ b/docs/type_system/overload.md @@ -5,7 +5,7 @@ List of complete functions, selected by signature ```text -Overload[[] Collection[Function[]]] +Overload[[] Collection[VAR_LIST; Function[]]] ``` ## Example diff --git a/docs/type_system/select.md b/docs/type_system/select.md index 73e7953..1b1d05a 100644 --- a/docs/type_system/select.md +++ b/docs/type_system/select.md @@ -5,15 +5,15 @@ A symbol associated with a type ```text -Select[[SINGLE | MULTIPLE] Type; Collection[.symbol : %const Value]] +Select[[SINGLE | MULTIPLE] Type; Collection[VAR_TREE; .symbol : %const Value]] ``` # Alias ```text -Enum[Generic.T; Collection[.symbol : %const Value]] `alias Select[[SINGLE]; Generic.T; Collection[.symbol : %const Value]] +Enum[Generic.T; Collection[.symbol : %const Value]] `alias Select[[SINGLE]; Generic.T; Collection[VAR_TREE; .symbol : %const Value]] -Mask[Generic.T; Collection[.symbol : %const Value]] `alias Select[[MULTIPLE]; Generic.T; Collection[.symbol : %const Value]] +Mask[Generic.T; Collection[.symbol : %const Value]] `alias Select[[MULTIPLE]; Generic.T; Collection[VAR_TREE; .symbol : %const Value]] ``` ## Definition Example diff --git a/docs/type_system/symbol.md b/docs/type_system/symbol.md index 5fb1c5e..3ce926e 100644 --- a/docs/type_system/symbol.md +++ b/docs/type_system/symbol.md @@ -3,5 +3,5 @@ --- ```text -Symbol[[] TARGET; TYPE] +Symbol[[] TARGET; TYPE; IDENTIFIER] ``` diff --git a/docs/type_system/union.md b/docs/type_system/union.md index 6682967..5a5b71f 100644 --- a/docs/type_system/union.md +++ b/docs/type_system/union.md @@ -3,13 +3,13 @@ --- ```text -Union[CONTAINER | TRANSIENT] Collection[TYPE.SYMBOL]] +Union[CONTAINER | TRANSIENT] Collection[VAR_TREE; TYPE.SYMBOL]] ``` # Alias ```text -Tag[Collection[TYPE.SYMBOL]] `alias Union[[CONTAINER] Collection[TYPE.SYMBOL]] +Tag[Collection[VAR_TREE; TYPE.SYMBOL]] `alias Union[[CONTAINER] Collection[VAR_TREE; TYPE.SYMBOL]] ``` ## Tag Example diff --git a/docs/type_system/var.md b/docs/type_system/var.md index 77e312c..86cbc8e 100644 --- a/docs/type_system/var.md +++ b/docs/type_system/var.md @@ -3,5 +3,15 @@ --- ```text -Var[[SCOPE | ARG | LOCAL | LOOP | IF | MATCH | MUTATE] TYPE; HASH; ID; LEFT_VAR; RIGHT_VAR] +Var[[SYMBOL | SCOPE | ARG | LOCAL | LOOP | IF | MATCH | MUTATE] TYPE; VALUE; LEFT_VAR; RIGHT_VAR; TREE_WEIGHT; IDENTIFIER] +``` + +## Type Body Object Definition + +```c +typedef struct { + kpl_ptr type, prev, next; + uint32_t tree_weight; + kpl_identifier identifier; +} type_var_body; ``` |
