Basic syntax for Reg-Lang
Gipson62 opened this issue · 2 comments
Gipson62 commented
Needed:
- Variables declaration
- Functions declaration
- If/else
- Loops (for/while/loop)
- Types name
Gipson62 commented
For now, we have this:
let message: String = "Hello, world"
fn main() -> void:
print(message)
add(5, 6)
fn add(a: int, b: int) -> int:
return a + b
fn loop_example(finish: int) -> void:
for x in range finish:
print(x)
fn condition_example() -> void:
if 4 > 5:
print("4 is bigger than 5")
else:
print("5 is bigger than 4")
(keep in mind that you can't declare variables outside functions except when you declare it as constant)