diff options
| author | Daniel Weipert <code@drogueronin.de> | 2023-08-25 16:24:59 +0200 | 
|---|---|---|
| committer | Daniel Weipert <code@drogueronin.de> | 2023-08-25 16:24:59 +0200 | 
| commit | b5cc10cff15797bc9f89724ab53ac7d296fbbc0c (patch) | |
| tree | 00f2ecd44cfe1c66149ec9217b60c2c9aaf262a2 /test | |
| parent | f7fddeaf9f0453054d4666d8a5b544d4c4cefebd (diff) | |
trying ply
Diffstat (limited to 'test')
| -rw-r--r-- | test/hello-world.hnshn | 28 | ||||
| -rw-r--r-- | test/test.test | 10 | 
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;  | 
