diff options
Diffstat (limited to 'docs/syntax.md')
| -rw-r--r-- | docs/syntax.md | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/docs/syntax.md b/docs/syntax.md new file mode 100644 index 0000000..0868143 --- /dev/null +++ b/docs/syntax.md @@ -0,0 +1,115 @@ +# Syntax + +--- + +## Comments + +```text +// Comment Until End Of Line + +/* Comment */ +``` + +## Numbers + +### Integers + +```text +1234 +1_000_000 +``` + +### Floats + +```text +1.2 +``` + +## Glyphs + +### Characters `''` + +```text +'a' +'Σ' +``` + +### Strings `""` + +## Operators + +### Symbol + +```text +1 + 2 +``` + +### Named ``[a-z]\w+` + +## Variables `[a-z][a-zA-Z0-9_]{0,49}` + +## Constants `_[a-zA-Z0-9_]{0,49}` + +## Types `[A-Z][a-zA-Z0-9_]{0,49}` + +## Tags `\.[a-zA-Z0-9_]{1,50}` + +## Blocks `{}` + +## Collections `()` + +## Modifiers `[]` + +## Separators `;|\n` + +## Actions + +### If `?` + +```text +? condition {[arguments] statements } { else statements } + +? { + condition {[arguments] statements } + ... + { else statements } +} +``` + +### Loop `@` + +```text +@.tag condition {[arguments] statements } +``` + +#### ``break.tag + +#### ``continue.tag + +### Match `#` + +```text +# match { + condition {[arguments] statements } + ... + { else statements } +} +``` + +## Coroutines ``{[] ... }` + +### ``return.tag + +### ``sync + +### ``async + +### ``await + +## Generators `^{[] ... }` + +### ``yield + +### ``stop + +### ``next |
