summaryrefslogtreecommitdiff
path: root/docs/syntax/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/syntax/index.md')
-rw-r--r--docs/syntax/index.md63
1 files changed, 60 insertions, 3 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 }
+}
+```