From b2f8be605d2b79d1d4b1995646e7058bec299a22 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 12 Jul 2026 23:17:06 +0200 Subject: Add fail_compilation tests --- source/main.elna | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source/main.elna') 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. -- cgit v1.2.3