From 25df78fd8598be2a63e22190ad40e5132f597264 Mon Sep 17 00:00:00 2001 From: Mikkel Kongsted Date: Fri, 1 Nov 2024 11:48:21 +0100 Subject: [PATCH] language specification --- example.slg | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 example.slg diff --git a/example.slg b/example.slg new file mode 100644 index 0000000..4eac52e --- /dev/null +++ b/example.slg @@ -0,0 +1,30 @@ + + +fn add(a: int, b: int) -> int { + a + b +} + +add(2,3); // -> 5 + +let a: string = "Hello"; + +let b = "world"; + +println(a + " " + b + "!"); // -> "Hello world!" + +if a == b { + println("whaaaat"); +} +else { + println(":o"); +} + +loop { + let i = 0; + + if i >= 10 { + break; + } + + i += 1; +} \ No newline at end of file