diff options
| -rw-r--r-- | docs/containers.md | 27 | ||||
| -rw-r--r-- | docs/coroutines.md | 7 | ||||
| -rw-r--r-- | docs/definitions.md | 4 | ||||
| -rw-r--r-- | docs/syntax.md | 10 | ||||
| -rw-r--r-- | docs/tagging.md | 57 | ||||
| -rw-r--r-- | docs/values.md | 123 | ||||
| -rw-r--r-- | mkdocs.yml | 3 |
7 files changed, 223 insertions, 8 deletions
diff --git a/docs/containers.md b/docs/containers.md new file mode 100644 index 0000000..7e9d97a --- /dev/null +++ b/docs/containers.md @@ -0,0 +1,27 @@ +# Containers + +--- + +## String + +## Array + +## Tuple + +## Table + +## Map + +## Set + +## Union + +## Any + +## Native + +## Namespace + +### ``import + +### ``export diff --git a/docs/coroutines.md b/docs/coroutines.md new file mode 100644 index 0000000..543f539 --- /dev/null +++ b/docs/coroutines.md @@ -0,0 +1,7 @@ +# Coroutines + +--- + +## Lambdas + +## Generators diff --git a/docs/definitions.md b/docs/definitions.md index a7bc028..0071473 100644 --- a/docs/definitions.md +++ b/docs/definitions.md @@ -30,6 +30,10 @@ A sequence of functions for a single `Task` A queue of coroutines on a container +### Interface + +A table of functions for a specific type of data + ## Data A representation of non executable bytes diff --git a/docs/syntax.md b/docs/syntax.md index dd468ed..08f87a4 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -80,6 +80,8 @@ ```text @.tag condition {[arguments] statements } + +@.tag (statement; condition; increment) { statements } ``` #### ``break @@ -96,7 +98,7 @@ } ``` -## Coroutines ``{[] ... }` +## Lambdas ``{[arguments] ... }` ### ``return @@ -106,10 +108,12 @@ ### ``await -## Generators `^{[] ... }` +## Generators `^{[arguments] ... }` + +### ``init ### ``yield -### ``stop +### ``done ### ``next diff --git a/docs/tagging.md b/docs/tagging.md index a469543..b7c0700 100644 --- a/docs/tagging.md +++ b/docs/tagging.md @@ -17,23 +17,23 @@ r : # x / y { If no tag is specified for an operation, `.value` is used -An invalid assertion produces an `Error` +An invalid assertion produces an `Error` with an `.error` tag ```text r : x /.value y r : x / y // same as above ``` -## Coroutines +## Lambdas If no tag is specified `.value` is used, user defined coroutines don't have to have a `.value` tag ### Returning ```text -co : `{[I64 x; I64 y] `return.value x + y } -co : `{[I64 x; I64 y] .value x + y } // same as above -co : `{[I64 x; I64 y] x + y } // same as above +add : `{[I64 x; I64 y] `return.value x + y } +add : `{[I64 x; I64 y] .value x + y } // same as above +add : `{[I64 x; I64 y] x + y } // same as above mu : `{[Bool i] ? i { .int 1 @@ -60,6 +60,38 @@ i : # mu `sync `false { i : mu `sync.int `true ``` +## Generators + +Generators use a `.done` tag to denote when it is complete + +```text +gen : ^{[I64 n] + @ 1 .. n {[x] + `yield x + // above is alias for -> `yield.value x + } + `done +} + +it : gen `init 10 +``` + +### Matching + +```text +v : # `next it { + .value {[x] x } + .done { -1 } +} +``` + +### Asserting + +```text +v : `next.value it +v : `next it // same as above +``` + ## Tables ### Creating @@ -78,4 +110,19 @@ table : Table (.a 1; .b 1.1) ### Break +```text +@.outer condtion { + @ condition { + `break.outer + } +} +``` + ### Continue + +```text +@ (x : 0; x < 10; x +: 2) { + ? x < 5 { `continue } + ... +} +``` diff --git a/docs/values.md b/docs/values.md new file mode 100644 index 0000000..da96b32 --- /dev/null +++ b/docs/values.md @@ -0,0 +1,123 @@ +# Values + +--- + +## Boolean + +* `Bool` + +### Operators + +* `=` + +* `!=` + +* `!` + +* `&` + +* `|` + +## Numbers + +### Integer + +* `I8` + +* `I16` + +* `I32` + +* `I64` + +* `U8` + +* `U16` + +* `U32` + +* `U64` + +### Operators + +* `!` + +* `=` + +* `!=` + +* `<` + +* `<=` + +* `>` + +* `>=` + +* `&` + +* `|` + +* `+` + +* `-` + +* `*` + +* `/` + +* `%` + +* ``~` + +* ``^` + +* ``&` + +* ``|` + +* ``<<` + +* ``>>` + +### Float + +* `F32` + +* `F64` + +### Operators + +* `!` + +* `=` + +* `!=` + +* `<` + +* `<=` + +* `>` + +* `>=` + +* `&` + +* `|` + +* `+` + +* `-` + +* `*` + +* `/` + +* `%` + +## Characters + +* `Char` + +### Operators @@ -9,3 +9,6 @@ nav: - Definitions: definitions.md - Syntax: syntax.md - Tagging: tagging.md + - Values: values.md + - Containers: containers.md + - Coroutines: coroutines.md |
