From 82cdf010329c4ac6827698689e7e39644fad07b6 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 6 May 2023 22:06:25 +0300 Subject: rename *.cu to *.ek + Name changes can be sort of difficult --- tests/callbacks.cu | 17 -------------- tests/callbacks.ek | 17 ++++++++++++++ tests/calls.cu | 19 ---------------- tests/calls.ek | 19 ++++++++++++++++ tests/empty.cu | 0 tests/empty.ek | 0 tests/enums.cu | 14 ------------ tests/enums.ek | 14 ++++++++++++ tests/import/priv_hello.cu | 1 - tests/import/priv_hello.ek | 1 + tests/import/pub_hello.cu | 1 - tests/import/pub_hello.ek | 1 + tests/import/pub_import_hello.cu | 1 - tests/import/pub_import_hello.ek | 1 + tests/loops.cu | 4 ---- tests/loops.ek | 4 ++++ tests/main.cu | 1 - tests/main.ek | 1 + tests/priv_hello.cu | 7 ------ tests/priv_hello.ek | 7 ++++++ tests/pub_hello.cu | 6 ----- tests/pub_hello.ek | 6 +++++ tests/pub_import_hello.cu | 6 ----- tests/pub_import_hello.ek | 6 +++++ tests/resolve.cu | 35 ----------------------------- tests/resolve.ek | 35 +++++++++++++++++++++++++++++ tests/structs.cu | 48 ---------------------------------------- tests/structs.ek | 48 ++++++++++++++++++++++++++++++++++++++++ tests/unions.cu | 23 ------------------- tests/unions.ek | 23 +++++++++++++++++++ tests/vars.cu | 33 --------------------------- tests/vars.ek | 33 +++++++++++++++++++++++++++ 32 files changed, 216 insertions(+), 216 deletions(-) delete mode 100644 tests/callbacks.cu create mode 100644 tests/callbacks.ek delete mode 100644 tests/calls.cu create mode 100644 tests/calls.ek delete mode 100644 tests/empty.cu create mode 100644 tests/empty.ek delete mode 100644 tests/enums.cu create mode 100644 tests/enums.ek delete mode 100644 tests/import/priv_hello.cu create mode 100644 tests/import/priv_hello.ek delete mode 100644 tests/import/pub_hello.cu create mode 100644 tests/import/pub_hello.ek delete mode 100644 tests/import/pub_import_hello.cu create mode 100644 tests/import/pub_import_hello.ek delete mode 100644 tests/loops.cu create mode 100644 tests/loops.ek delete mode 100644 tests/main.cu create mode 100644 tests/main.ek delete mode 100644 tests/priv_hello.cu create mode 100644 tests/priv_hello.ek delete mode 100644 tests/pub_hello.cu create mode 100644 tests/pub_hello.ek delete mode 100644 tests/pub_import_hello.cu create mode 100644 tests/pub_import_hello.ek delete mode 100644 tests/resolve.cu create mode 100644 tests/resolve.ek delete mode 100644 tests/structs.cu create mode 100644 tests/structs.ek delete mode 100644 tests/unions.cu create mode 100644 tests/unions.ek delete mode 100644 tests/vars.cu create mode 100644 tests/vars.ek (limited to 'tests') diff --git a/tests/callbacks.cu b/tests/callbacks.cu deleted file mode 100644 index 0249065..0000000 --- a/tests/callbacks.cu +++ /dev/null @@ -1,17 +0,0 @@ -do_stuff(proc '(u32)) -{ - proc(); -} - -other_proc(u32) -{ -} - -other_proc() -{ -} - -main() -{ - do_stuff(other_proc as '(u32)); -} diff --git a/tests/callbacks.ek b/tests/callbacks.ek new file mode 100644 index 0000000..0249065 --- /dev/null +++ b/tests/callbacks.ek @@ -0,0 +1,17 @@ +do_stuff(proc '(u32)) +{ + proc(); +} + +other_proc(u32) +{ +} + +other_proc() +{ +} + +main() +{ + do_stuff(other_proc as '(u32)); +} diff --git a/tests/calls.cu b/tests/calls.cu deleted file mode 100644 index 4978649..0000000 --- a/tests/calls.cu +++ /dev/null @@ -1,19 +0,0 @@ -typedef some_type { - add(some_type, some_type => some_type); -} - -add(a u32, b u32 => u32) -{ - return a + b; -} - -/* ah fuck, analyze_proc gobbles up the typeof */ -some_proc(a some_type, b typeof a => typeof a) -{ - return add(a, b); -} - -main() -{ - some_proc(20 as u32, 40 as u32); -} diff --git a/tests/calls.ek b/tests/calls.ek new file mode 100644 index 0000000..4978649 --- /dev/null +++ b/tests/calls.ek @@ -0,0 +1,19 @@ +typedef some_type { + add(some_type, some_type => some_type); +} + +add(a u32, b u32 => u32) +{ + return a + b; +} + +/* ah fuck, analyze_proc gobbles up the typeof */ +some_proc(a some_type, b typeof a => typeof a) +{ + return add(a, b); +} + +main() +{ + some_proc(20 as u32, 40 as u32); +} diff --git a/tests/empty.cu b/tests/empty.cu deleted file mode 100644 index e69de29..0000000 diff --git a/tests/empty.ek b/tests/empty.ek new file mode 100644 index 0000000..e69de29 diff --git a/tests/enums.cu b/tests/enums.cu deleted file mode 100644 index f52f5d6..0000000 --- a/tests/enums.cu +++ /dev/null @@ -1,14 +0,0 @@ -enum A { - a = 200, - b -} - -enum B: u8 { - b, c -} - -main() -{ - a const = a::A; - b const = b::B; -} diff --git a/tests/enums.ek b/tests/enums.ek new file mode 100644 index 0000000..f52f5d6 --- /dev/null +++ b/tests/enums.ek @@ -0,0 +1,14 @@ +enum A { + a = 200, + b +} + +enum B: u8 { + b, c +} + +main() +{ + a const = a::A; + b const = b::B; +} diff --git a/tests/import/priv_hello.cu b/tests/import/priv_hello.cu deleted file mode 100644 index 970efcd..0000000 --- a/tests/import/priv_hello.cu +++ /dev/null @@ -1 +0,0 @@ -hello(){} diff --git a/tests/import/priv_hello.ek b/tests/import/priv_hello.ek new file mode 100644 index 0000000..970efcd --- /dev/null +++ b/tests/import/priv_hello.ek @@ -0,0 +1 @@ +hello(){} diff --git a/tests/import/pub_hello.cu b/tests/import/pub_hello.cu deleted file mode 100644 index f26624e..0000000 --- a/tests/import/pub_hello.cu +++ /dev/null @@ -1 +0,0 @@ -pub hello(){} diff --git a/tests/import/pub_hello.ek b/tests/import/pub_hello.ek new file mode 100644 index 0000000..f26624e --- /dev/null +++ b/tests/import/pub_hello.ek @@ -0,0 +1 @@ +pub hello(){} diff --git a/tests/import/pub_import_hello.cu b/tests/import/pub_import_hello.cu deleted file mode 100644 index 4e6a851..0000000 --- a/tests/import/pub_import_hello.cu +++ /dev/null @@ -1 +0,0 @@ -pub import "pub_hello.cu"; diff --git a/tests/import/pub_import_hello.ek b/tests/import/pub_import_hello.ek new file mode 100644 index 0000000..4e6a851 --- /dev/null +++ b/tests/import/pub_import_hello.ek @@ -0,0 +1 @@ +pub import "pub_hello.cu"; diff --git a/tests/loops.cu b/tests/loops.cu deleted file mode 100644 index 5b6f702..0000000 --- a/tests/loops.cu +++ /dev/null @@ -1,4 +0,0 @@ -/* this should error out with some decent message about type loops or something - * */ -f(=>typeof main()){} -main(=> typeof f()){} diff --git a/tests/loops.ek b/tests/loops.ek new file mode 100644 index 0000000..5b6f702 --- /dev/null +++ b/tests/loops.ek @@ -0,0 +1,4 @@ +/* this should error out with some decent message about type loops or something + * */ +f(=>typeof main()){} +main(=> typeof f()){} diff --git a/tests/main.cu b/tests/main.cu deleted file mode 100644 index 05437c5..0000000 --- a/tests/main.cu +++ /dev/null @@ -1 +0,0 @@ -main(){} diff --git a/tests/main.ek b/tests/main.ek new file mode 100644 index 0000000..05437c5 --- /dev/null +++ b/tests/main.ek @@ -0,0 +1 @@ +main(){} diff --git a/tests/priv_hello.cu b/tests/priv_hello.cu deleted file mode 100644 index ef0f4c9..0000000 --- a/tests/priv_hello.cu +++ /dev/null @@ -1,7 +0,0 @@ -import "import/priv_hello.cu" - -main() -{ - /* expect this to fail */ - hello(); -} diff --git a/tests/priv_hello.ek b/tests/priv_hello.ek new file mode 100644 index 0000000..ef0f4c9 --- /dev/null +++ b/tests/priv_hello.ek @@ -0,0 +1,7 @@ +import "import/priv_hello.cu" + +main() +{ + /* expect this to fail */ + hello(); +} diff --git a/tests/pub_hello.cu b/tests/pub_hello.cu deleted file mode 100644 index e6bea3b..0000000 --- a/tests/pub_hello.cu +++ /dev/null @@ -1,6 +0,0 @@ -import "import/pub_hello.cu"; - -main() -{ - hello(); -} diff --git a/tests/pub_hello.ek b/tests/pub_hello.ek new file mode 100644 index 0000000..e6bea3b --- /dev/null +++ b/tests/pub_hello.ek @@ -0,0 +1,6 @@ +import "import/pub_hello.cu"; + +main() +{ + hello(); +} diff --git a/tests/pub_import_hello.cu b/tests/pub_import_hello.cu deleted file mode 100644 index a0aeb31..0000000 --- a/tests/pub_import_hello.cu +++ /dev/null @@ -1,6 +0,0 @@ -import "import/pub_import_hello.cu"; - -main() -{ - hello(); -} diff --git a/tests/pub_import_hello.ek b/tests/pub_import_hello.ek new file mode 100644 index 0000000..a0aeb31 --- /dev/null +++ b/tests/pub_import_hello.ek @@ -0,0 +1,6 @@ +import "import/pub_import_hello.cu"; + +main() +{ + hello(); +} diff --git a/tests/resolve.cu b/tests/resolve.cu deleted file mode 100644 index 1be0916..0000000 --- a/tests/resolve.cu +++ /dev/null @@ -1,35 +0,0 @@ -typedef A {} - -struct generic (T1 A, T2 A) { - a T1; - b T2; -} - -struct other_generic(T1 A) { - a T1; - b T1; -} - -/* wow this works pretty good */ -//some_func(a A, b typeof a, c i64){1;} -//some_func(a A, b typeof a, c typeof b){2;} -//some_func(a A, b typeof a, c A){3;} -//some_func(a generic(u32, u32)) {5;} -//some_func(a other_generic){6;} -// TODO: partial templates shouldn't be allowed -//some_func(a generic(u32)){6;} -//some_func(a generic) {4;} -// illegal -// TODO: traits shouldn't be allowed in template instantiation -//some_func(a generic(A, A)){6;} -//some_func(generic(generic, generic)){1;} -//some_func(generic(generic, i64)){2;} -//some_func(generic(i64, generic)){3;} -//some_func(generic(i64, i64)){4;} -some_func(generic){5;} - -main(){ - // TODO: not fully qualified types in bodies should cause an error - a generic(i64, generic); - some_func(a); -} diff --git a/tests/resolve.ek b/tests/resolve.ek new file mode 100644 index 0000000..1be0916 --- /dev/null +++ b/tests/resolve.ek @@ -0,0 +1,35 @@ +typedef A {} + +struct generic (T1 A, T2 A) { + a T1; + b T2; +} + +struct other_generic(T1 A) { + a T1; + b T1; +} + +/* wow this works pretty good */ +//some_func(a A, b typeof a, c i64){1;} +//some_func(a A, b typeof a, c typeof b){2;} +//some_func(a A, b typeof a, c A){3;} +//some_func(a generic(u32, u32)) {5;} +//some_func(a other_generic){6;} +// TODO: partial templates shouldn't be allowed +//some_func(a generic(u32)){6;} +//some_func(a generic) {4;} +// illegal +// TODO: traits shouldn't be allowed in template instantiation +//some_func(a generic(A, A)){6;} +//some_func(generic(generic, generic)){1;} +//some_func(generic(generic, i64)){2;} +//some_func(generic(i64, generic)){3;} +//some_func(generic(i64, i64)){4;} +some_func(generic){5;} + +main(){ + // TODO: not fully qualified types in bodies should cause an error + a generic(i64, generic); + some_func(a); +} diff --git a/tests/structs.cu b/tests/structs.cu deleted file mode 100644 index 8a3a1bb..0000000 --- a/tests/structs.cu +++ /dev/null @@ -1,48 +0,0 @@ -typedef any {} - -struct basic_struct { - a i64; - b i64; - c i64; -} - -struct complex_struct (A any, B any, C any) { - a A; - b B; - c C; -} - -main() -{ - /* infer types */ - simple_named const = {.a = 1, .b = 2, .c = 3} as basic_struct; - simple_ordinal const = {1, 2, 3} as basic_struct; - simple_mixed const = {1, .b = 2, 3} as basic_struct; - - complex_named const = {.a = 1, .b = 2, .c = 3} as complex_struct; - /* should parentheses be required around typeof? */ - complex_ordinal const = {1, 2, 3} as typeof complex_named; - complex_mixed const = {1, .b = 2, 3} as complex_struct; - - /* force types */ - force_named complex_struct(u32, u32, u32) = {.a = 1, .b = 2, .c = 3}; - force_ordinal typeof force_named = {1, 2, 3}; - force_mixed typeof force_ordinal = {1, .b = 2, 3}; - - force_inferred_named mut = {.a = 1, .b = 2, .c = 3} as - complex_struct(u32, u32, u32); - - force_inferred_ordinal mut = {1, 2, 3} as - complex_struct(u32, u32, u32); - - force_inferred_mixed mut = {1, .b = 2, 3} as - complex_struct(u32, u32, u32); - - /* shouldn't be compileable due to not enough type info */ - // error_named const = {.a = 1, .b = 2, .c = 3}; - - /* types should be inferred */ - force_inferred_named = {.a = 2, .b = 3, .c = 4}; - force_inferred_ordinal = {2, 3, 4}; - force_inferred_mixed = {2, .b = 3, 4}; -} diff --git a/tests/structs.ek b/tests/structs.ek new file mode 100644 index 0000000..8a3a1bb --- /dev/null +++ b/tests/structs.ek @@ -0,0 +1,48 @@ +typedef any {} + +struct basic_struct { + a i64; + b i64; + c i64; +} + +struct complex_struct (A any, B any, C any) { + a A; + b B; + c C; +} + +main() +{ + /* infer types */ + simple_named const = {.a = 1, .b = 2, .c = 3} as basic_struct; + simple_ordinal const = {1, 2, 3} as basic_struct; + simple_mixed const = {1, .b = 2, 3} as basic_struct; + + complex_named const = {.a = 1, .b = 2, .c = 3} as complex_struct; + /* should parentheses be required around typeof? */ + complex_ordinal const = {1, 2, 3} as typeof complex_named; + complex_mixed const = {1, .b = 2, 3} as complex_struct; + + /* force types */ + force_named complex_struct(u32, u32, u32) = {.a = 1, .b = 2, .c = 3}; + force_ordinal typeof force_named = {1, 2, 3}; + force_mixed typeof force_ordinal = {1, .b = 2, 3}; + + force_inferred_named mut = {.a = 1, .b = 2, .c = 3} as + complex_struct(u32, u32, u32); + + force_inferred_ordinal mut = {1, 2, 3} as + complex_struct(u32, u32, u32); + + force_inferred_mixed mut = {1, .b = 2, 3} as + complex_struct(u32, u32, u32); + + /* shouldn't be compileable due to not enough type info */ + // error_named const = {.a = 1, .b = 2, .c = 3}; + + /* types should be inferred */ + force_inferred_named = {.a = 2, .b = 3, .c = 4}; + force_inferred_ordinal = {2, 3, 4}; + force_inferred_mixed = {2, .b = 3, 4}; +} diff --git a/tests/unions.cu b/tests/unions.cu deleted file mode 100644 index 6c3edc5..0000000 --- a/tests/unions.cu +++ /dev/null @@ -1,23 +0,0 @@ -typedef any {} - -union basic_union { - a u32; - b i64; - c f32; -} - -union complex_union(A any, B any, C any) { - a A; - b B; - c C; -} - -main() -{ - simple_named const = {.b = 1} as basic_union; - simple_ordinal const = {1 as u32} as basic_union; - - // TODO: unions should be fully actualized - complex_named const = {.b = 1} as complex_union(u32, i64, f32); - complex_ordinal const = {1 as u32} as complex_union(u32, i64, f32); -} diff --git a/tests/unions.ek b/tests/unions.ek new file mode 100644 index 0000000..6c3edc5 --- /dev/null +++ b/tests/unions.ek @@ -0,0 +1,23 @@ +typedef any {} + +union basic_union { + a u32; + b i64; + c f32; +} + +union complex_union(A any, B any, C any) { + a A; + b B; + c C; +} + +main() +{ + simple_named const = {.b = 1} as basic_union; + simple_ordinal const = {1 as u32} as basic_union; + + // TODO: unions should be fully actualized + complex_named const = {.b = 1} as complex_union(u32, i64, f32); + complex_ordinal const = {1 as u32} as complex_union(u32, i64, f32); +} diff --git a/tests/vars.cu b/tests/vars.cu deleted file mode 100644 index 8780e3f..0000000 --- a/tests/vars.cu +++ /dev/null @@ -1,33 +0,0 @@ -typedef any {} - -struct some_struct { - a i64; -} - -struct some_template (A any) { - a A; -} - -main() -{ - a mut i64 = 20; - a = 200; - - b mut some_struct = {20}; - b = {200}; - - c mut = {20} as some_struct; - c = {200}; - - d mut some_template = {20}; - d = {200}; - - e mut some_template (i64) = {20}; - e = {200}; - - f mut = {20} as some_template; - f = {200}; - - g mut = {20} as some_template(i64); - g = {200}; -} diff --git a/tests/vars.ek b/tests/vars.ek new file mode 100644 index 0000000..8780e3f --- /dev/null +++ b/tests/vars.ek @@ -0,0 +1,33 @@ +typedef any {} + +struct some_struct { + a i64; +} + +struct some_template (A any) { + a A; +} + +main() +{ + a mut i64 = 20; + a = 200; + + b mut some_struct = {20}; + b = {200}; + + c mut = {20} as some_struct; + c = {200}; + + d mut some_template = {20}; + d = {200}; + + e mut some_template (i64) = {20}; + e = {200}; + + f mut = {20} as some_template; + f = {200}; + + g mut = {20} as some_template(i64); + g = {200}; +} -- cgit v1.3