From b5cc10cff15797bc9f89724ab53ac7d296fbbc0c Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 25 Aug 2023 16:24:59 +0200 Subject: trying ply --- test/hello-world.hnshn | 28 ++++++++++++++++++++++++++++ test/test.test | 10 +++++----- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 test/hello-world.hnshn (limited to 'test') 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; -- cgit v1.2.3