From 233115cf2c70660c7dde03624a8c6e1dab15f9c3 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Fri, 30 Sep 2022 16:20:28 +0200 Subject: [PATCH] File naming convention change --- README.md | 4 ++-- core_codegen_c_language.cpp | 2 +- core_compiler.cpp | 2 +- core_main.cpp | 1 - ...rays_and_slices.kl => arrays_and_slices.core} | 0 ... => drawing_to_screen_using_windows_api.core} | 14 +++++++------- .../{language_basics.kl => language_basics.core} | 0 ..._overloading.kl => operator_overloading.core} | 7 ------- ...ns.kl => order_independent_declarations.core} | 0 examples/{raymarcher.kl => raymarcher.core} | 16 ++++++++-------- ...ormation.kl => runtime_type_information.core} | 0 ...alues.kl => types_as_first_class_values.core} | 0 modules/{arena.kl => Arena.core} | 4 ++-- modules/{base.kl => Base.core} | 4 ++-- modules/{gdi32.kl => GDI32.core} | 2 +- modules/{kernel32.kl => KERNEL32.core} | 0 modules/{language.kl => Language.core} | 0 modules/{math.kl => Math.core} | 0 modules/{user32.kl => USER32.core} | 2 +- modules/{winmm.kl => WINMM.core} | 2 +- modules/{os_windows.kl => Windows.core} | 4 ++-- 21 files changed, 28 insertions(+), 36 deletions(-) rename examples/{arrays_and_slices.kl => arrays_and_slices.core} (100%) rename examples/{drawing_to_screen_using_windows_api.kl => drawing_to_screen_using_windows_api.core} (94%) rename examples/{language_basics.kl => language_basics.core} (100%) rename examples/{operator_overloading.kl => operator_overloading.core} (94%) rename examples/{order_independent_declarations.kl => order_independent_declarations.core} (100%) rename examples/{raymarcher.kl => raymarcher.core} (97%) rename examples/{runtime_type_information.kl => runtime_type_information.core} (100%) rename examples/{types_as_first_class_values.kl => types_as_first_class_values.core} (100%) rename modules/{arena.kl => Arena.core} (95%) rename modules/{base.kl => Base.core} (98%) rename modules/{gdi32.kl => GDI32.core} (98%) rename modules/{kernel32.kl => KERNEL32.core} (100%) rename modules/{language.kl => Language.core} (100%) rename modules/{math.kl => Math.core} (100%) rename modules/{user32.kl => USER32.core} (99%) rename modules/{winmm.kl => WINMM.core} (80%) rename modules/{os_windows.kl => Windows.core} (98%) diff --git a/README.md b/README.md index afdc53e..f0d838c 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ The language is currently **very debuggable**. It can produce readable C code wi // Virtual memory abstraction using Windows API // -#import "kernel32.kl" -#import "base.kl" +#import "KERNEL32.core" +#import "Base.core" PAGE_SIZE :: 4096 Memory :: struct diff --git a/core_codegen_c_language.cpp b/core_codegen_c_language.cpp index 36c20aa..d7f7b9e 100644 --- a/core_codegen_c_language.cpp +++ b/core_codegen_c_language.cpp @@ -832,7 +832,7 @@ typedef struct String{ compiler_error(0, "Entry point is not defined! Try main or WinMain"); } - // Generate language.kl + // Generate language.core for(S32 i = 0; i < pctx->base_language_ordered_decl_len; i++){ Ast_Decl *it = get(&pctx->ordered_decls, i); genln(""); diff --git a/core_compiler.cpp b/core_compiler.cpp index a31f00f..29ffe96 100644 --- a/core_compiler.cpp +++ b/core_compiler.cpp @@ -247,7 +247,7 @@ compile_file_to_string(String filename){ total_time = os_time(); begin_compilation(); { - Ast_Module *module = add_module(0, pctx->intern("language.kl"_s)); + Ast_Module *module = add_module(0, pctx->intern("Language.core"_s)); insert_builtin_types_into_scope(module); pctx->language_base_module = module; diff --git a/core_main.cpp b/core_main.cpp index 280073f..e13a0a4 100644 --- a/core_main.cpp +++ b/core_main.cpp @@ -285,7 +285,6 @@ int main(int argument_count, char **arguments){ else { Scratch scratch; Array examples = os_list_dir(scratch, "examples"_s); - // compile_file("examples/language_basics.kl"_s, COMPILE_AND_RUN); For(examples){ if(it.is_directory) continue; compile_file(it.absolute_path, COMPILE_AND_RUN | COMPILE_TESTING); diff --git a/examples/arrays_and_slices.kl b/examples/arrays_and_slices.core similarity index 100% rename from examples/arrays_and_slices.kl rename to examples/arrays_and_slices.core diff --git a/examples/drawing_to_screen_using_windows_api.kl b/examples/drawing_to_screen_using_windows_api.core similarity index 94% rename from examples/drawing_to_screen_using_windows_api.kl rename to examples/drawing_to_screen_using_windows_api.core index 666c705..23e938a 100644 --- a/examples/drawing_to_screen_using_windows_api.kl +++ b/examples/drawing_to_screen_using_windows_api.core @@ -1,10 +1,10 @@ -#import "base.kl" -#import "arena.kl" -#import "os_windows.kl" -#import "kernel32.kl" -#import "gdi32.kl" -#import "user32.kl" -#import "winmm.kl" +#import "Base.core" +#import "Arena.core" +#import "Windows.core" +#import "KERNEL32.core" +#import "GDI32.core" +#import "USER32.core" +#import "WINMM.core" Vec2I :: struct;; x: S64; y: S64 Vec2 :: struct;; x: F32; y: F32 diff --git a/examples/language_basics.kl b/examples/language_basics.core similarity index 100% rename from examples/language_basics.kl rename to examples/language_basics.core diff --git a/examples/operator_overloading.kl b/examples/operator_overloading.core similarity index 94% rename from examples/operator_overloading.kl rename to examples/operator_overloading.core index 34c9ed4..689575d 100644 --- a/examples/operator_overloading.kl +++ b/examples/operator_overloading.core @@ -19,11 +19,4 @@ main :: (): int e := c - d Assert(e.x == 6 && e.y == 8 && e.z == 10) - test_string := " - - Memes - - - " - return 0 \ No newline at end of file diff --git a/examples/order_independent_declarations.kl b/examples/order_independent_declarations.core similarity index 100% rename from examples/order_independent_declarations.kl rename to examples/order_independent_declarations.core diff --git a/examples/raymarcher.kl b/examples/raymarcher.core similarity index 97% rename from examples/raymarcher.kl rename to examples/raymarcher.core index b978903..8a192cb 100644 --- a/examples/raymarcher.kl +++ b/examples/raymarcher.core @@ -1,4 +1,4 @@ -#import "math.kl" +#import "Math.core" Epsilon :: 0.00001 Screen : *U32 @@ -90,13 +90,13 @@ Raymarcher_Update :: () // Windows specific code // -#import "base.kl" -#import "arena.kl" -#import "os_windows.kl" -#import "kernel32.kl" -#import "gdi32.kl" -#import "user32.kl" -#import "winmm.kl" +#import "Base.core" +#import "Arena.core" +#import "Windows.core" +#import "KERNEL32.core" +#import "GDI32.core" +#import "USER32.core" +#import "WINMM.core" Windows_Bitmap :: struct size: Vec2I diff --git a/examples/runtime_type_information.kl b/examples/runtime_type_information.core similarity index 100% rename from examples/runtime_type_information.kl rename to examples/runtime_type_information.core diff --git a/examples/types_as_first_class_values.kl b/examples/types_as_first_class_values.core similarity index 100% rename from examples/types_as_first_class_values.kl rename to examples/types_as_first_class_values.core diff --git a/modules/arena.kl b/modules/Arena.core similarity index 95% rename from modules/arena.kl rename to modules/Arena.core index 001fcb1..8573f1e 100644 --- a/modules/arena.kl +++ b/modules/Arena.core @@ -1,5 +1,5 @@ -OS :: #import "os_windows.kl" -Base :: #import "base.kl" +OS :: #import "Windows.core" +Base :: #import "Base.core" ArenaDI: U64 ADDITIONAL_COMMIT_SIZE :: 1024*1024 diff --git a/modules/base.kl b/modules/Base.core similarity index 98% rename from modules/base.kl rename to modules/Base.core index a4d2d93..e808856 100644 --- a/modules/base.kl +++ b/modules/Base.core @@ -1,5 +1,5 @@ -OS :: #import "os_windows.kl" -#import "arena.kl" +OS :: #import "Windows.core" +#import "Arena.core" SizeU :: U64 ClampTopSizeU :: (val: SizeU, max: SizeU): SizeU diff --git a/modules/gdi32.kl b/modules/GDI32.core similarity index 98% rename from modules/gdi32.kl rename to modules/GDI32.core index 47e2055..ae1dcde 100644 --- a/modules/gdi32.kl +++ b/modules/GDI32.core @@ -1,4 +1,4 @@ -#import "kernel32.kl" +#import "KERNEL32.core" RBGQUAD :: struct;; rgbBlue: BYTE; rgbGreen: BYTE; rgbRed: BYTE; rgbReserved: BYTE BITMAPINFOHEADER :: struct;; biSize: DWORD; biWidth: LONG; biHeight: LONG; biPlanes: WORD; biBitCount: WORD; biCompression: DWORD; biSizeImage: DWORD; biXPelsPerMeter: LONG; biYPelsPerMeter: LONG; biClrUsed: DWORD; biClrImportant: DWORD BITMAPINFO :: struct;; bmiHeader: BITMAPINFOHEADER; bmiColors: [1]RBGQUAD diff --git a/modules/kernel32.kl b/modules/KERNEL32.core similarity index 100% rename from modules/kernel32.kl rename to modules/KERNEL32.core diff --git a/modules/language.kl b/modules/Language.core similarity index 100% rename from modules/language.kl rename to modules/Language.core diff --git a/modules/math.kl b/modules/Math.core similarity index 100% rename from modules/math.kl rename to modules/Math.core diff --git a/modules/user32.kl b/modules/USER32.core similarity index 99% rename from modules/user32.kl rename to modules/USER32.core index 4447694..d3b68bd 100644 --- a/modules/user32.kl +++ b/modules/USER32.core @@ -1,4 +1,4 @@ -#import "kernel32.kl" +#import "KERNEL32.core" WNDPROC :: (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT WNDCLASSW :: struct;; style: UINT; lpfnWndProc: WNDPROC; cbClsExtra: int; cbWndExtra: int; hInstance: HINSTANCE; hIcon: HICON; hCursor: HCURSOR; hbrBackground: HBRUSH; lpszMenuName: LPCWSTR; lpszClassName: LPCWSTR MSG :: struct;; hwnd: HWND; message: UINT; wParam: WPARAM; lParam: LPARAM; time: DWORD; pt: POINT; lPrivate: DWORD diff --git a/modules/winmm.kl b/modules/WINMM.core similarity index 80% rename from modules/winmm.kl rename to modules/WINMM.core index 4608215..3ff15e0 100644 --- a/modules/winmm.kl +++ b/modules/WINMM.core @@ -1,4 +1,4 @@ -#import "kernel32.kl" +#import "KERNEL32.core" MMRESULT :: UINT TIMERR_NOERROR :: 0 diff --git a/modules/os_windows.kl b/modules/Windows.core similarity index 98% rename from modules/os_windows.kl rename to modules/Windows.core index f0f7c75..d26705e 100644 --- a/modules/os_windows.kl +++ b/modules/Windows.core @@ -1,5 +1,5 @@ -#import "kernel32.kl" -#import "base.kl" +#import "KERNEL32.core" +#import "Base.core" PAGE_SIZE :: 4096 Memory :: struct