aboutsummaryrefslogtreecommitdiff
path: root/source/main.elna
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-12 23:17:06 +0200
committerEugen Wissner <belka@caraus.de>2026-07-12 23:17:06 +0200
commitb2f8be605d2b79d1d4b1995646e7058bec299a22 (patch)
treeb5dd4a434103d440d7c541badc3cf3097e8ac967 /source/main.elna
parentfea8ff27f53f960ff7149b360446589a0748aeb5 (diff)
downloadelna-b2f8be605d2b79d1d4b1995646e7058bec299a22.tar.gz
Add fail_compilation tests
Diffstat (limited to 'source/main.elna')
-rw-r--r--source/main.elna18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/main.elna b/source/main.elna
index 781d681..9a43fb8 100644
--- a/source/main.elna
+++ b/source/main.elna
@@ -17,7 +17,7 @@ type
capacity: Word
end
SourceCode = record
- position: TextLocation;
+ position: ElnaLocation;
input: Pointer;
empty: proc(stream: Pointer): Bool;
@@ -29,6 +29,11 @@ type
data: ^^ElnaLexerToken
end
+var
+ stdout: ^FILE
+ stderr: ^FILE
+ stdin: ^FILE
+
(*
Standard procedures.
*)
@@ -826,7 +831,7 @@ begin
fclose(source_file^.handle)
end;
- source_code.position := TextLocation(1u, 1u);
+ source_code.position := ElnaLocation(1u, 1u);
source_code.input := source_file;
source_code.empty := source_file_empty;
source_code.head := source_file_head;
@@ -837,5 +842,14 @@ begin
return return_code
end
+proc initialize_global_state()
+begin
+ stdin := fdopen(0, "r\0".ptr);
+ stdout := fdopen(1, "w\0".ptr);
+ stderr := fdopen(2, "w\0".ptr)
+end
+
+begin
+ initialize_global_state();
return process(count, parameters)
end.