From 496ef1254b41de5f490c10c39dafe3b8ddc1a55a Mon Sep 17 00:00:00 2001 From: nodist Date: Sat, 22 Aug 2026 15:37:56 -0400 Subject: new syntax --- docs/syntax.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 docs/syntax.md (limited to 'docs/syntax.md') 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 -- cgit v1.2.3