comments yay

This commit is contained in:
uan
2026-02-07 15:14:42 +01:00
parent 90ab17da24
commit 7fddf9ab30
3 changed files with 24 additions and 4 deletions

View File

@@ -30,6 +30,17 @@ const x int = 9;
```
---
### Comments
Comments in One start with a # and end with another # or a newline
```
#this is a comment
let a #this is also a comment# int = 9;
```
---
### Scopes
Like in most languages, variables in One are only limited to their scope.
@@ -62,7 +73,7 @@ let x int = 3
let y real = 5.5;
print(y);
}
print("y is now undefined again here");
#y is now undefined again here
{
let y real = 0.2;
print(y);
@@ -223,7 +234,7 @@ The 'main' function must always return `int` and does not accept any arguments.
```
fn main() int {
print("my code here");
#my code here
}
```