From fd774948e6ac3506c24e6b87b6ef98403aa85951 Mon Sep 17 00:00:00 2001 From: nodist Date: Mon, 8 Jun 2026 11:38:20 -0400 Subject: add action and remove assigment from namespace --- docs/index.md | 4 ++-- docs/language/index.md | 26 +++++++++++++++++++++----- docs/language/operators.md | 6 ++++-- docs/type_system/action.md | 9 +++++++++ docs/type_system/buffer.md | 2 +- docs/type_system/index.md | 12 +++++++++--- docs/type_system/map.md | 2 +- docs/type_system/namespace.md | 4 ++-- docs/type_system/op.md | 2 +- docs/type_system/union.md | 10 +++++----- 10 files changed, 55 insertions(+), 22 deletions(-) create mode 100644 docs/type_system/action.md (limited to 'docs') diff --git a/docs/index.md b/docs/index.md index d298e04..08e02d1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -28,10 +28,10 @@ This specification not only describes the language syntax but it's implementatio // Do Soemthing readFile("filename", callback(data)) // Continue while readFile is running -// langauge equivalent +// --- langauge equivalent // Do Soemthing Fn[name; callback] $ ( - ( read; open ) : `use "io" + ( read; open ) `use "io" callback `sync read `sync open `sync name ) `async ("filename"; callback) // Continue while readFile is running diff --git a/docs/language/index.md b/docs/language/index.md index b63d3e4..a5dce76 100644 --- a/docs/language/index.md +++ b/docs/language/index.md @@ -126,7 +126,7 @@ Arguments are specified with a `[]` at the beginning of the `{}` ## Conditionals -#### Loop `@` +### Loop `@` ```text @ condition { statements } @@ -138,7 +138,23 @@ Arguments are specified with a `[]` at the beginning of the `{}` @.name condition {[args] statements } ``` -#### If `?` +#### ``break` `break .name` + +Stops a loop + +```text +@.a 1 .. 5 {[x] + @.b 1 .. 5 {[y] + ? x = y { `break .a } + } +} +``` + +#### ``continue` `continue .name` + +Move loop to next iteration + +### If `?` ```text ? condition { statements } @@ -148,10 +164,10 @@ Arguments are specified with a `[]` at the beginning of the `{}` { default statements } } -? condition {[arg] arg; .... } +? condition {[args] statements } ``` -#### Match `#` +### Match `#` ```text # match { @@ -161,7 +177,7 @@ Arguments are specified with a `[]` at the beginning of the `{}` } ``` -#### Mutation `^` +### Mutation `^` ```test ^ mutation {[args] statements } diff --git a/docs/language/operators.md b/docs/language/operators.md index dbf17ea..183b2d3 100644 --- a/docs/language/operators.md +++ b/docs/language/operators.md @@ -8,9 +8,11 @@ ## Cast `$` -## `log +## ``log` -If no `File` is specified the output is send to `stdout` +Configurable logger, output format and destination can be changed + +## ``debugger` ## ``format` diff --git a/docs/type_system/action.md b/docs/type_system/action.md new file mode 100644 index 0000000..2917b69 --- /dev/null +++ b/docs/type_system/action.md @@ -0,0 +1,9 @@ +# Action + +--- + +```text +Action_class `alias Enum[.unknown; .loop; .if; .match; .mutation] + +Action[Action_class; SCOPE; Parent; TARGET; ARGS; STATEMENTS ...] +``` diff --git a/docs/type_system/buffer.md b/docs/type_system/buffer.md index c7c0354..256cb40 100644 --- a/docs/type_system/buffer.md +++ b/docs/type_system/buffer.md @@ -15,7 +15,7 @@ Buffer[Buffer_repesentation; TYPE] ```text String `alias Buffer[.utf8; Void] -Array[Any] `alias Buffer[.type; Any] +Array[Generic.T] `alias Buffer[.type; Generic.T] ``` # Operators diff --git a/docs/type_system/index.md b/docs/type_system/index.md index 59cf118..bf5870a 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -16,7 +16,7 @@ Template[Field; ...] If a field in a template is not filed, one of these are required: -##### Any +### Any Denotes a field in a template that has not resolved @@ -26,11 +26,15 @@ A template by name only expands to all inner fields as `Any` Int -> Int[Any; Any; Any] ``` -##### Is[TYPE; ...] +### Is[TYPE; ...] Denotes the type is one of the specified types in the list -##### Void +### Generic.SYMBOL + +Generic for alias and unique types, type is replaced with type passed + +### Void Denotes that a field that does not resolve to anything @@ -90,4 +94,6 @@ Denotes that a field that does not resolve to anything * #### [List](./list.md) +* #### [Action](./action.md) + * #### [Namespace](./namespace.md) diff --git a/docs/type_system/map.md b/docs/type_system/map.md index feaf853..4947842 100644 --- a/docs/type_system/map.md +++ b/docs/type_system/map.md @@ -9,7 +9,7 @@ Map[KEY_TYPE; VALUE_TYPE] # Alias ```text -Set[Any] `alias Map[Any; Void] +Set[Generic.T] `alias Map[Generic.T; Void] ``` # Operators diff --git a/docs/type_system/namespace.md b/docs/type_system/namespace.md index f38e8ab..f6b8b1c 100644 --- a/docs/type_system/namespace.md +++ b/docs/type_system/namespace.md @@ -20,13 +20,13 @@ A file with code ### \`import ```text -Namespace : `import Value[String] +Namespace `import Value[String] ``` ### \`use ```text -Namespace : `use Value[String] +Namespace `use Value[String] ``` ## Main diff --git a/docs/type_system/op.md b/docs/type_system/op.md index 5dd9f74..e17868b 100644 --- a/docs/type_system/op.md +++ b/docs/type_system/op.md @@ -3,7 +3,7 @@ --- ```text -Op_class : Enum[.loop; .if; .match; .mutation; .selection; ...] +Op_class `alias Enum[.loop; .if; .match; .mutation; .selection; ...] Op[Op_class; RETURN_TYPE; LEFT_TYPE; RIGHT_TYPE] ``` diff --git a/docs/type_system/union.md b/docs/type_system/union.md index 5bd3d10..2c4be2d 100644 --- a/docs/type_system/union.md +++ b/docs/type_system/union.md @@ -28,15 +28,15 @@ Can only be retuned from functions and operations. The inner value must be moved ## Alias ```text -Result[ANY] `alias Union[.transient; ANY.value; Error.error] +Result[Generic.T] `alias Union[.transient; Generic.T.value; Error.error] -Option[ANY] `alias Union[.transient; ANY.some; Void.none] +Option[Generic.T] `alias Union[.transient; Generic.T.some; Void.none] -Next[Any] `alias Union[.transient; ANY.iter; Void.done] +Next[Generic.T] `alias Union[.transient; Generic.T.iter; Void.done] -Next_result[Any] `alias Union[.transient; ANY.value; Error.error; Void.done] +Next_result[Generic.T] `alias Union[.transient; Generic.T.value; Error.error; Void.done] -Next_option[Any] `alias Union[.transient; ANY.some; Void.none; Void.done] +Next_option[Generic.T] `alias Union[.transient; Generic.T.some; Void.none; Void.done] ``` ## Default Operation -- cgit v1.2.3