diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-05-04 15:48:21 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-05-04 15:48:21 -0400 |
| commit | a03ece3989cd708af1a4663316d20b37d4368b3f (patch) | |
| tree | 3de539d6730c30b31d57627d72f8dea9e02d4598 /docs | |
| parent | d0698df5d7ded7c65478c923caf11bfa2c5efa68 (diff) | |
add lists and conditionals
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/syntax/index.md | 63 | ||||
| -rw-r--r-- | docs/type_system/index.md | 2 |
2 files changed, 61 insertions, 4 deletions
diff --git a/docs/syntax/index.md b/docs/syntax/index.md index 27160b2..7047de3 100644 --- a/docs/syntax/index.md +++ b/docs/syntax/index.md @@ -12,7 +12,7 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ \s\t\n ``` -## Comments +# Comments ```text // This is a comment until the end of the line @@ -20,6 +20,8 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ /* Comment block */ ``` +# Atoms + ## Number Literals ##### Integer @@ -40,7 +42,7 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ Underscores `_` can separate digits in a number -```test +```text 100_000 1.100_000 ``` @@ -68,7 +70,7 @@ Variables starting with `_` are treated as unused Start with an uppercase letter -## Operators +# Operators Represented as an symbol or a keyword starting with \` @@ -76,3 +78,58 @@ Represented as an symbol or a keyword starting with \` 1 + 2 1 `add 2 ``` + +# Symbols + +Start with a `.` + +```test +.symbol +``` + +# Lists + +A list of statements between `()` separated by `;` or `\n` + +# Definitions + +A list of type definitions between `[]` separated by `;` or `\n` + +# Actions + +A list of statements between `{}` separated by `;` or `\n` that can be associated with a conditional + +## Conditionals + +#### Loop `@` + +```text +@ condition { statements } + +@ condition { statements }[args] + +@ condition { statements }[.name] + +@ condition { statements }[.name; args] +``` + +#### If `?` + +```text +? condition { statements } + +? { + condition { statements } + { default statements } +} +``` + +#### Match `#` + +```text +# match { + target { statements } + target { statements }[args] + { default statements } +} +``` diff --git a/docs/type_system/index.md b/docs/type_system/index.md index 59cd18d..79371d0 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -2,6 +2,6 @@ --- -## Templates +# Templates A template is an incomplete type |
