diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/syntax/index.md | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/docs/syntax/index.md b/docs/syntax/index.md index 4343a2f..27160b2 100644 --- a/docs/syntax/index.md +++ b/docs/syntax/index.md @@ -2,7 +2,7 @@ --- -##### Code is encoded as UTF-8, allowed glyphs are: +Code is encoded as UTF-8, allowed glyphs are: ```text abcdefghijklmnopqrstuvwxyz @@ -12,26 +12,67 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ \s\t\n ``` -##### Any UTF-8 glyph is allowed between `""` +## Comments ```text -Ω - Invalid code -"Ω" - Valid code +// This is a comment until the end of the line + +/* Comment block */ ``` -## Comments +## Number Literals + +##### Integer +```text +12 // Decimal +0x12 // Hex +0b10 // Binary +0o75 // Octal ``` -// This is a comment until the end of the line -/* Comment block */ +##### Float + +```text +1.2 +1e6 ``` +Underscores `_` can separate digits in a number + +```test +100_000 +1.100_000 +``` + +## String Literals + +```text +"Asdf\n" +``` + +Any UTF-8 glyph is allowed between `""` + +```text +Ω // Invalid code +"Ω" // Valid code +``` + +## Variable Names + +Start with a lowercase letter + +Variables starting with `_` are treated as unused + +## Type Names + +Start with an uppercase letter + ## Operators Represented as an symbol or a keyword starting with \` -``` +```text 1 + 2 1 `add 2 ``` |
