diff options
Diffstat (limited to 'source/main.elna')
| -rw-r--r-- | source/main.elna | 18 |
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. |
