From f7b035a505e86ad916a43ab1dc1a662a6066b011 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 24 Sep 2026 00:39:51 +0200 Subject: Move module heading to the top --- source/cctype.elna | 1 + source/command_line_interface.elna | 2 +- source/common.elna | 2 +- source/cstdio.elna | 1 + source/cstdlib.elna | 1 + source/cstring.elna | 1 + source/lexer.elna | 2 +- source/main.elna | 8 ++++---- 8 files changed, 11 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/cctype.elna b/source/cctype.elna index 13dc50a..19c3491 100644 --- a/source/cctype.elna +++ b/source/cctype.elna @@ -1,6 +1,7 @@ (* 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 proc isdigit*(c: Int ) -> Int extern diff --git a/source/command_line_interface.elna b/source/command_line_interface.elna index 0feb53b..511d6a0 100644 --- a/source/command_line_interface.elna +++ b/source/command_line_interface.elna @@ -1,10 +1,10 @@ (* 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/. *) - (* Command line handling. *) +module import cstdlib, cstring, common type diff --git a/source/common.elna b/source/common.elna index 0a50fe1..e31def8 100644 --- a/source/common.elna +++ b/source/common.elna @@ -1,7 +1,7 @@ (* 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, cstdlib type diff --git a/source/cstdio.elna b/source/cstdio.elna index bf74234..e69d81a 100644 --- a/source/cstdio.elna +++ b/source/cstdio.elna @@ -1,6 +1,7 @@ (* 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 type FILE* = extern diff --git a/source/cstdlib.elna b/source/cstdlib.elna index 09b1ddf..9b858e7 100644 --- a/source/cstdlib.elna +++ b/source/cstdlib.elna @@ -1,6 +1,7 @@ (* 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 proc malloc*(size: Word) -> Pointer extern diff --git a/source/cstring.elna b/source/cstring.elna index 70c468c..dcf9e6f 100644 --- a/source/cstring.elna +++ b/source/cstring.elna @@ -1,6 +1,7 @@ (* 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 proc memset*(ptr: Pointer; c: Int; n: Word) -> ^Word8 extern diff --git a/source/lexer.elna b/source/lexer.elna index 1cfe097..bf1c449 100644 --- a/source/lexer.elna +++ b/source/lexer.elna @@ -1,7 +1,7 @@ (* 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 cstdio, common, cstdlib type diff --git a/source/main.elna b/source/main.elna index 955f313..adac5ac 100644 --- a/source/main.elna +++ b/source/main.elna @@ -2,7 +2,9 @@ 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/. *) -import cstdio, cstdlib, cstring, cctype, common, command_line_interface, lexer +program(parameters) +import + cstdio, cstdlib, cstring, cctype, common, command_line_interface, lexer type SourceFile* = record @@ -825,10 +827,8 @@ begin stderr := fdopen(2, "w\0".ptr) return -program(parameters) begin initialize_global_state(); -return cast(process(cast(parameters.length: Int), parameters.ptr): Word8) - + exit(process(cast(parameters.length: Int), parameters.ptr)) end. -- cgit v1.2.3