diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-08-23 14:16:11 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-08-23 14:16:11 -0400 |
| commit | 96b5c3ae7a1178e5169540b900e11d9a802d15ac (patch) | |
| tree | d8674a4f4a8452bf3cf73c7ca61affb82f9523ba /docs | |
| parent | 496ef1254b41de5f490c10c39dafe3b8ddc1a55a (diff) | |
tagging page examples
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/syntax.md | 6 | ||||
| -rw-r--r-- | docs/tagging.md | 58 |
2 files changed, 61 insertions, 3 deletions
diff --git a/docs/syntax.md b/docs/syntax.md index 0868143..dd468ed 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -82,9 +82,9 @@ @.tag condition {[arguments] statements } ``` -#### ``break.tag +#### ``break -#### ``continue.tag +#### ``continue ### Match `#` @@ -98,7 +98,7 @@ ## Coroutines ``{[] ... }` -### ``return.tag +### ``return ### ``sync diff --git a/docs/tagging.md b/docs/tagging.md index e2bcf69..a469543 100644 --- a/docs/tagging.md +++ b/docs/tagging.md @@ -6,16 +6,74 @@ ### Matching +```text +r : # x / y { + .value {[value] value } + .error {[error] `log error; 0 } +} +``` + ### Asserting +If no tag is specified for an operation, `.value` is used + +An invalid assertion produces an `Error` + +```text +r : x /.value y +r : x / y // same as above +``` + ## Coroutines +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 +mu : `{[Bool i] + ? i { + .int 1 + } { + .float 1.1 + } +} +``` + +### Matching + +```text +// using the mu corotuine from above +i : # mu `sync `false { + .int {[i] i } + .float {[f] I64 f } +} +``` + +### Asserting + +```text +// using the mu coroutine from aboce +i : mu `sync.int `true +``` + ## Tables +### Creating + +```text +table : Table (.a 1; .b 1.1) +``` + ### Accessing +```text +`log table.a +``` + ## Loops ### Break |
