summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/hello-world.hnshn28
-rw-r--r--test/test.test10
2 files changed, 33 insertions, 5 deletions
diff --git a/test/hello-world.hnshn b/test/hello-world.hnshn
new file mode 100644
index 0000000..4d4af3d
--- /dev/null
+++ b/test/hello-world.hnshn
@@ -0,0 +1,28 @@
+const std = import('@std');
+
+function main(): void {
+ const integer: integer32 = 123;
+ const string: string = '123';
+ const array: [integer32][3] = [1, 2, 3];
+ const map: [string][string|integer32] = [
+ 'first': 1,
+ 'second': 'two',
+ 'third': 3,
+ ];
+
+ for (array) |index, value| {
+ // cool
+ }
+
+ for (map) |key, value| {
+ // also cool
+ }
+
+ for (string) |index, char| {
+ // cool?
+ const char2 = std.str.get_char_at_index(string, index);
+ }
+
+ std.str.format('cool %s', string)
+ |> print($);
+}
diff --git a/test/test.test b/test/test.test
index 44580c7..5bbd0c0 100644
--- a/test/test.test
+++ b/test/test.test
@@ -1,6 +1,6 @@
-function henshin(hen: integer, shin: integer): void {
- const x: integer = 2
- const b: string = x
+const henshin: integer = 2; // comment
+// next comment
+var ply: string = "cool!";
+ply = "way cooler!!";
- return b
-}
+const new: integer = henshin * 5 + 10;