Fix errors in README examples

This commit is contained in:
germax26 2024-08-11 23:33:56 +10:00
parent 1688296528
commit 2b840ff8b9
Signed by: germax26
SSH Key Fingerprint: SHA256:N3w+8798IMWBt7SYH8G1C0iJlIa2HIIcRCXwILT5FvM

View File

@ -15,9 +15,9 @@ The following is a non-comprehensive list of stuff that currently works.
## Assignment & Declaration
```
a: str= "Hello, World!\n";
a: str = "Hello, World!\n";
b: int = 0;
c: str;
c: str; // declared, but not yet assigned
```
## Structs
@ -70,7 +70,7 @@ enum IntResult {
Err(Error)
}
result: IntResult = Ok(5);
result: IntResult = IntResult.Ok(5);
match result in {
case Ok(num) do { ... } // num is defined in this scope
@ -86,14 +86,14 @@ func random_number(seed: int) -> int {
return 42;
}
my_random_number = random_number(69);
my_random_number: int = random_number(69);
func min(a: int, b: int) -> int {
if a < b return a;
return b;
}
the_min = min(5, 10);
the_min: int = min(5, 10);
```
## Arrays