aboutsummaryrefslogtreecommitdiff
path: root/source/common.elna
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-03 08:53:03 +0200
committerEugen Wissner <belka@caraus.de>2026-07-03 08:53:03 +0200
commit4ad6052aa2816f8296e62569272e99fc0d2fd3c1 (patch)
treee1002f3fc1d51929b6f7b77f4769eb84be4e9e82 /source/common.elna
parent453332311ac2d569093f9ef62d41d13b0ce024c8 (diff)
downloadelna-4ad6052aa2816f8296e62569272e99fc0d2fd3c1.tar.gz
Merge variable_expression and named_type_expression
Diffstat (limited to 'source/common.elna')
-rw-r--r--source/common.elna40
1 files changed, 20 insertions, 20 deletions
diff --git a/source/common.elna b/source/common.elna
index e7b30ca..33a79b8 100644
--- a/source/common.elna
+++ b/source/common.elna
@@ -1,50 +1,50 @@
(* This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at https://mozilla.org/MPL/2.0/. *)
-module;
-import cstring, cstdio;
+import cstring, cstdio
type
- Identifier = [256]Char;
+ Identifier = [256]Char
TextLocation* = record
line: Word;
column: Word
- end;
+ end
-proc write*(fd: Int, buf: Pointer, Word: Int) -> Int; extern;
+proc write*(fd: Int, buf: Pointer, Word: Int) -> Int
+extern
-proc write_s*(value: String);
+proc write_s*(value: String)
begin
(* fwrite(cast(value.ptr: Pointer), value.length, 1u, stdout) *)
write(1, cast(value.ptr: Pointer), cast(value.length: Int))
-end;
+end
-proc write_z*(value: ^Char);
+proc write_z*(value: ^Char)
begin
write(1, cast(value: Pointer), cast(strlen(value): Int))
-end;
+end
-proc write_b*(value: Bool);
+proc write_b*(value: Bool)
begin
if value then
write_s("true")
else
write_s("false")
end
-end;
+end
-proc write_c*(value: Char);
+proc write_c*(value: Char)
begin
putchar(cast(value: Int));
fflush(nil)
-end;
+end
-proc write_i*(value: Int);
+proc write_i*(value: Int)
var
- digit: Int;
- n: Word;
- buffer: [10]Char;
+ digit: Int
+ n: Word
+ buffer: [10]Char
begin
n := 10u;
@@ -62,11 +62,11 @@ begin
n := n + 1u;
write_c(buffer[n])
end
-end;
+end
-proc write_u*(value: Word);
+proc write_u*(value: Word)
begin
write_i(cast(value: Int))
-end;
+end
end.