aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--progs/tests/_simple.sy23
-rw-r--r--progs/tests/blob/cluster.sy (renamed from progs/tests/cluster.sy)0
-rw-r--r--progs/tests/blob/complex.sy (renamed from progs/tests/blob_complex.sy)2
-rw-r--r--progs/tests/blob/field.sy (renamed from progs/tests/field.sy)0
-rw-r--r--progs/tests/blob/field_assign.sy (renamed from progs/tests/field_assign.sy)0
-rw-r--r--progs/tests/blob/field_get.sy (renamed from progs/tests/field_get.sy)0
-rw-r--r--progs/tests/blob/infer.sy (renamed from progs/tests/blob_infer.sy)2
-rw-r--r--progs/tests/blob/instantiate.sy (renamed from progs/tests/instantiate.sy)0
-rw-r--r--progs/tests/blob/multiple_fields.sy (renamed from progs/tests/multiple_fields.sy)0
-rw-r--r--progs/tests/blob/simple.sy (renamed from progs/tests/blob_simple.sy)0
-rw-r--r--progs/tests/constant/declaration_order.sy (renamed from progs/tests/constants_declaration_order.sy)0
-rw-r--r--progs/tests/constant/declaration_order_wrong.sy (renamed from progs/tests/constants_declaration_order_wrong.sy)0
-rw-r--r--progs/tests/constant/function.sy (renamed from progs/tests/constant_function.sy)0
-rw-r--r--progs/tests/constant/function_closure.sy (renamed from progs/tests/constant_function_closure.sy)0
-rw-r--r--progs/tests/constant/function_complex.sy (renamed from progs/tests/constant_function_complex.sy)0
-rw-r--r--progs/tests/constant/global_collision.sy (renamed from progs/tests/global_collision.sy)0
-rw-r--r--progs/tests/constant/global_constants.sy (renamed from progs/tests/global_constants.sy)0
-rw-r--r--progs/tests/constant/in_inner_functions.sy (renamed from progs/tests/constants_in_inner_functions.sy)0
-rw-r--r--progs/tests/expression/add.sy (renamed from progs/tests/simple_add.sy)0
-rw-r--r--progs/tests/expression/boolean_ops_count.sy (renamed from progs/tests/boolean_ops.sy)19
-rw-r--r--progs/tests/expression/boolean_order.sy (renamed from progs/tests/boolean_order.sy)4
-rw-r--r--progs/tests/expression/div.sy (renamed from progs/tests/div.sy)0
-rw-r--r--progs/tests/expression/in_rhs.sy (renamed from progs/tests/in_rhs.sy)0
-rw-r--r--progs/tests/expression/negation.sy (renamed from progs/tests/negation.sy)0
-rw-r--r--progs/tests/expression/parenthesis.sy (renamed from progs/tests/parenthesis.sy)0
-rw-r--r--progs/tests/expression/simple.sy (renamed from progs/tests/expressions.sy)1
-rw-r--r--progs/tests/expression/sub.sy (renamed from progs/tests/simple_sub.sy)0
-rw-r--r--progs/tests/expression/terms_and_factors.sy (renamed from progs/tests/terms_and_factors.sy)0
-rw-r--r--progs/tests/func/calls_inside_calls.sy (renamed from progs/tests/calls_inside_calls.sy)0
-rw-r--r--progs/tests/func/exclamation_calling.sy (renamed from progs/tests/not.sy)0
-rw-r--r--progs/tests/func/inner_simple.sy (renamed from progs/tests/simplest.sy)0
-rw-r--r--progs/tests/func/multiple_returns.sy (renamed from progs/tests/multiple_returns.sy)0
-rw-r--r--progs/tests/func/one_arg.sy (renamed from progs/tests/one_arg.sy)0
-rw-r--r--progs/tests/func/param_1.sy (renamed from progs/tests/param_1.sy)0
-rw-r--r--progs/tests/func/param_2.sy (renamed from progs/tests/param_2.sy)0
-rw-r--r--progs/tests/func/param_and_return.sy (renamed from progs/tests/param_and_return.sy)0
-rw-r--r--progs/tests/func/passing_functions_as_arguments.sy (renamed from progs/tests/passing_functions.sy)0
-rw-r--r--progs/tests/func/passing_functions_as_arguments_mixed.sy (renamed from progs/tests/passing_functions_mixed.sy)0
-rw-r--r--progs/tests/func/precedence.sy (renamed from progs/tests/precedence.sy)0
-rw-r--r--progs/tests/func/return_1.sy (renamed from progs/tests/return_1.sy)0
-rw-r--r--progs/tests/func/returning_closures.sy (renamed from progs/tests/returning_closures.sy)0
-rw-r--r--progs/tests/func/three_arg.sy (renamed from progs/tests/three_arg.sy)0
-rw-r--r--progs/tests/func/two_arg.sy (renamed from progs/tests/two_arg.sy)0
-rw-r--r--progs/tests/func/uncallable_type.sy (renamed from progs/tests/uncallable_type.sy)0
-rw-r--r--progs/tests/func/wrong_params.sy (renamed from progs/tests/wrong_params.sy)0
-rw-r--r--progs/tests/func/wrong_ret.sy (renamed from progs/tests/wrong_ret.sy)0
-rw-r--r--progs/tests/if_else.sy (renamed from progs/tests/else_.sy)0
-rw-r--r--progs/tests/if_else_if.sy (renamed from progs/tests/else_if.sy)0
-rw-r--r--progs/tests/loop_for.sy (renamed from progs/tests/for.sy)16
-rw-r--r--progs/tests/tuple/add.sy (renamed from progs/tests/add.sy)0
-rw-r--r--progs/tests/tuple/basic.sy (renamed from progs/tests/tuples.sy)0
-rw-r--r--progs/tests/tuple/fail_invalid_singleton.sy (renamed from progs/tests/tuples_fail_invalid_singleton.sy)0
-rw-r--r--progs/tests/tuple/fail_out_of_bounds.sy (renamed from progs/tests/tuples_fail_out_of_bounds.sy)0
-rw-r--r--progs/tests/tuple/mul.sy (renamed from progs/tests/mul.sy)0
-rw-r--r--progs/tests/tuple/multiple_types.sy (renamed from progs/tests/more_types.sy)0
-rw-r--r--progs/tests/tuple/sub.sy (renamed from progs/tests/sub.sy)0
-rw-r--r--progs/tests/tuple/types.sy (renamed from progs/tests/types.sy)0
-rw-r--r--sylt_macro/src/lib.rs2
58 files changed, 21 insertions, 48 deletions
diff --git a/progs/tests/_simple.sy b/progs/tests/_simple.sy
deleted file mode 100644
index 84bc86d..0000000
--- a/progs/tests/_simple.sy
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// import A
-
-//
-f :: fn {
- g!
- print q
-}
-
-//
-q :: 1
-
-//
-a := 1
-
-qq :: fn {
- g!
- print q
-}
-
-
-// Steg 1: Hitta sektioner
-// Dela sektioner, compilera felera sektioner efter varandra
diff --git a/progs/tests/cluster.sy b/progs/tests/blob/cluster.sy
index dc8ec72..dc8ec72 100644
--- a/progs/tests/cluster.sy
+++ b/progs/tests/blob/cluster.sy
diff --git a/progs/tests/blob_complex.sy b/progs/tests/blob/complex.sy
index b139a3a..88c37a7 100644
--- a/progs/tests/blob_complex.sy
+++ b/progs/tests/blob/complex.sy
@@ -1,5 +1,4 @@
start :: fn {
-
a := A()
b := B()
c := C()
@@ -15,5 +14,4 @@ start :: fn {
}
blob C { }
blob B { }
-
}
diff --git a/progs/tests/field.sy b/progs/tests/blob/field.sy
index b11e51e..b11e51e 100644
--- a/progs/tests/field.sy
+++ b/progs/tests/blob/field.sy
diff --git a/progs/tests/field_assign.sy b/progs/tests/blob/field_assign.sy
index 4fb6dd4..4fb6dd4 100644
--- a/progs/tests/field_assign.sy
+++ b/progs/tests/blob/field_assign.sy
diff --git a/progs/tests/field_get.sy b/progs/tests/blob/field_get.sy
index 49bb0f2..49bb0f2 100644
--- a/progs/tests/field_get.sy
+++ b/progs/tests/blob/field_get.sy
diff --git a/progs/tests/blob_infer.sy b/progs/tests/blob/infer.sy
index 0a1ce1b..1dd7fec 100644
--- a/progs/tests/blob_infer.sy
+++ b/progs/tests/blob/infer.sy
@@ -1,8 +1,6 @@
start :: fn {
-
blob A { }
a : A = A()
a
-
}
diff --git a/progs/tests/instantiate.sy b/progs/tests/blob/instantiate.sy
index bb2f09c..bb2f09c 100644
--- a/progs/tests/instantiate.sy
+++ b/progs/tests/blob/instantiate.sy
diff --git a/progs/tests/multiple_fields.sy b/progs/tests/blob/multiple_fields.sy
index ce4c61f..ce4c61f 100644
--- a/progs/tests/multiple_fields.sy
+++ b/progs/tests/blob/multiple_fields.sy
diff --git a/progs/tests/blob_simple.sy b/progs/tests/blob/simple.sy
index ea832cd..ea832cd 100644
--- a/progs/tests/blob_simple.sy
+++ b/progs/tests/blob/simple.sy
diff --git a/progs/tests/constants_declaration_order.sy b/progs/tests/constant/declaration_order.sy
index 93e6117..93e6117 100644
--- a/progs/tests/constants_declaration_order.sy
+++ b/progs/tests/constant/declaration_order.sy
diff --git a/progs/tests/constants_declaration_order_wrong.sy b/progs/tests/constant/declaration_order_wrong.sy
index 37f5050..37f5050 100644
--- a/progs/tests/constants_declaration_order_wrong.sy
+++ b/progs/tests/constant/declaration_order_wrong.sy
diff --git a/progs/tests/constant_function.sy b/progs/tests/constant/function.sy
index 22ddfe2..22ddfe2 100644
--- a/progs/tests/constant_function.sy
+++ b/progs/tests/constant/function.sy
diff --git a/progs/tests/constant_function_closure.sy b/progs/tests/constant/function_closure.sy
index 6c7f0d7..6c7f0d7 100644
--- a/progs/tests/constant_function_closure.sy
+++ b/progs/tests/constant/function_closure.sy
diff --git a/progs/tests/constant_function_complex.sy b/progs/tests/constant/function_complex.sy
index 6a60ebe..6a60ebe 100644
--- a/progs/tests/constant_function_complex.sy
+++ b/progs/tests/constant/function_complex.sy
diff --git a/progs/tests/global_collision.sy b/progs/tests/constant/global_collision.sy
index 6bce509..6bce509 100644
--- a/progs/tests/global_collision.sy
+++ b/progs/tests/constant/global_collision.sy
diff --git a/progs/tests/global_constants.sy b/progs/tests/constant/global_constants.sy
index 7ee6ca5..7ee6ca5 100644
--- a/progs/tests/global_constants.sy
+++ b/progs/tests/constant/global_constants.sy
diff --git a/progs/tests/constants_in_inner_functions.sy b/progs/tests/constant/in_inner_functions.sy
index 99704e7..99704e7 100644
--- a/progs/tests/constants_in_inner_functions.sy
+++ b/progs/tests/constant/in_inner_functions.sy
diff --git a/progs/tests/simple_add.sy b/progs/tests/expression/add.sy
index 7be4012..7be4012 100644
--- a/progs/tests/simple_add.sy
+++ b/progs/tests/expression/add.sy
diff --git a/progs/tests/boolean_ops.sy b/progs/tests/expression/boolean_ops_count.sy
index 368068b..b4a43e9 100644
--- a/progs/tests/boolean_ops.sy
+++ b/progs/tests/expression/boolean_ops_count.sy
@@ -21,7 +21,7 @@ start :: fn {
}
if t() || i() {
- // Empty
+ // This block is intentionally left blank
} else {
<!>
}
@@ -31,7 +31,7 @@ start :: fn {
}
if t() || i() || i() {
- // Empty
+ // This block is intentionally left blank
} else {
<!>
}
@@ -39,18 +39,3 @@ start :: fn {
fs <=> 2
ts <=> 2
}
-
-
-
- // if t() || i() && f() {
- // // Empty
- // } else {
- // <!>
- // }
-
- // if f() && t() || i() {
- // // Empty
- // } else {
- // <!>
- // }
-
diff --git a/progs/tests/boolean_order.sy b/progs/tests/expression/boolean_order.sy
index ecec262..567c068 100644
--- a/progs/tests/boolean_order.sy
+++ b/progs/tests/expression/boolean_order.sy
@@ -17,13 +17,13 @@ start :: fn {
}
if t() || i() && i() {
- // Empty
+ // This block is intentionally left blank
} else {
<!>
}
if f() && i() || t() {
- // Empty
+ // This block is intentionally left blank
} else {
<!>
}
diff --git a/progs/tests/div.sy b/progs/tests/expression/div.sy
index df3e7bb..df3e7bb 100644
--- a/progs/tests/div.sy
+++ b/progs/tests/expression/div.sy
diff --git a/progs/tests/in_rhs.sy b/progs/tests/expression/in_rhs.sy
index 28ed276..28ed276 100644
--- a/progs/tests/in_rhs.sy
+++ b/progs/tests/expression/in_rhs.sy
diff --git a/progs/tests/negation.sy b/progs/tests/expression/negation.sy
index 0c702aa..0c702aa 100644
--- a/progs/tests/negation.sy
+++ b/progs/tests/expression/negation.sy
diff --git a/progs/tests/parenthesis.sy b/progs/tests/expression/parenthesis.sy
index dd6fe8a..dd6fe8a 100644
--- a/progs/tests/parenthesis.sy
+++ b/progs/tests/expression/parenthesis.sy
diff --git a/progs/tests/expressions.sy b/progs/tests/expression/simple.sy
index 99569e4..29d7c76 100644
--- a/progs/tests/expressions.sy
+++ b/progs/tests/expression/simple.sy
@@ -2,5 +2,4 @@ start :: fn {
1 + 1 // blargh
2 // blargh
// HARGH
-
}
diff --git a/progs/tests/simple_sub.sy b/progs/tests/expression/sub.sy
index c220b8f..c220b8f 100644
--- a/progs/tests/simple_sub.sy
+++ b/progs/tests/expression/sub.sy
diff --git a/progs/tests/terms_and_factors.sy b/progs/tests/expression/terms_and_factors.sy
index 42a48e2..42a48e2 100644
--- a/progs/tests/terms_and_factors.sy
+++ b/progs/tests/expression/terms_and_factors.sy
diff --git a/progs/tests/calls_inside_calls.sy b/progs/tests/func/calls_inside_calls.sy
index 5f6716b..5f6716b 100644
--- a/progs/tests/calls_inside_calls.sy
+++ b/progs/tests/func/calls_inside_calls.sy
diff --git a/progs/tests/not.sy b/progs/tests/func/exclamation_calling.sy
index 02dd81d..02dd81d 100644
--- a/progs/tests/not.sy
+++ b/progs/tests/func/exclamation_calling.sy
diff --git a/progs/tests/simplest.sy b/progs/tests/func/inner_simple.sy
index 14a6534..14a6534 100644
--- a/progs/tests/simplest.sy
+++ b/progs/tests/func/inner_simple.sy
diff --git a/progs/tests/multiple_returns.sy b/progs/tests/func/multiple_returns.sy
index 6cb5e1a..6cb5e1a 100644
--- a/progs/tests/multiple_returns.sy
+++ b/progs/tests/func/multiple_returns.sy
diff --git a/progs/tests/one_arg.sy b/progs/tests/func/one_arg.sy
index e7dee83..e7dee83 100644
--- a/progs/tests/one_arg.sy
+++ b/progs/tests/func/one_arg.sy
diff --git a/progs/tests/param_1.sy b/progs/tests/func/param_1.sy
index c96089e..c96089e 100644
--- a/progs/tests/param_1.sy
+++ b/progs/tests/func/param_1.sy
diff --git a/progs/tests/param_2.sy b/progs/tests/func/param_2.sy
index 1915c42..1915c42 100644
--- a/progs/tests/param_2.sy
+++ b/progs/tests/func/param_2.sy
diff --git a/progs/tests/param_and_return.sy b/progs/tests/func/param_and_return.sy
index 2752fcc..2752fcc 100644
--- a/progs/tests/param_and_return.sy
+++ b/progs/tests/func/param_and_return.sy
diff --git a/progs/tests/passing_functions.sy b/progs/tests/func/passing_functions_as_arguments.sy
index e09a125..e09a125 100644
--- a/progs/tests/passing_functions.sy
+++ b/progs/tests/func/passing_functions_as_arguments.sy
diff --git a/progs/tests/passing_functions_mixed.sy b/progs/tests/func/passing_functions_as_arguments_mixed.sy
index b08128e..b08128e 100644
--- a/progs/tests/passing_functions_mixed.sy
+++ b/progs/tests/func/passing_functions_as_arguments_mixed.sy
diff --git a/progs/tests/precedence.sy b/progs/tests/func/precedence.sy
index ae08e05..ae08e05 100644
--- a/progs/tests/precedence.sy
+++ b/progs/tests/func/precedence.sy
diff --git a/progs/tests/return_1.sy b/progs/tests/func/return_1.sy
index 533208f..533208f 100644
--- a/progs/tests/return_1.sy
+++ b/progs/tests/func/return_1.sy
diff --git a/progs/tests/returning_closures.sy b/progs/tests/func/returning_closures.sy
index 4d69d5a..4d69d5a 100644
--- a/progs/tests/returning_closures.sy
+++ b/progs/tests/func/returning_closures.sy
diff --git a/progs/tests/three_arg.sy b/progs/tests/func/three_arg.sy
index 56eb634..56eb634 100644
--- a/progs/tests/three_arg.sy
+++ b/progs/tests/func/three_arg.sy
diff --git a/progs/tests/two_arg.sy b/progs/tests/func/two_arg.sy
index 09ea1f7..09ea1f7 100644
--- a/progs/tests/two_arg.sy
+++ b/progs/tests/func/two_arg.sy
diff --git a/progs/tests/uncallable_type.sy b/progs/tests/func/uncallable_type.sy
index dbe6e81..dbe6e81 100644
--- a/progs/tests/uncallable_type.sy
+++ b/progs/tests/func/uncallable_type.sy
diff --git a/progs/tests/wrong_params.sy b/progs/tests/func/wrong_params.sy
index 0082a3a..0082a3a 100644
--- a/progs/tests/wrong_params.sy
+++ b/progs/tests/func/wrong_params.sy
diff --git a/progs/tests/wrong_ret.sy b/progs/tests/func/wrong_ret.sy
index 6c4a9a5..6c4a9a5 100644
--- a/progs/tests/wrong_ret.sy
+++ b/progs/tests/func/wrong_ret.sy
diff --git a/progs/tests/else_.sy b/progs/tests/if_else.sy
index 0f1d624..0f1d624 100644
--- a/progs/tests/else_.sy
+++ b/progs/tests/if_else.sy
diff --git a/progs/tests/else_if.sy b/progs/tests/if_else_if.sy
index f31453e..f31453e 100644
--- a/progs/tests/else_if.sy
+++ b/progs/tests/if_else_if.sy
diff --git a/progs/tests/for.sy b/progs/tests/loop_for.sy
index 285cbc3..f9e27d4 100644
--- a/progs/tests/for.sy
+++ b/progs/tests/loop_for.sy
@@ -18,4 +18,20 @@ start :: fn {
}
}
a <=> 9
+
+ a = 0
+ for i := 0, i < 10, i = i + 1 {
+ for j := i, j < 10, j = j + 1 {
+ a = a + i * j
+ }
+ }
+ a <=> 1155
+
+ a = 0
+ for i := 0, i < 10, i = i + 1 {
+ for j := 0, j < i, j = j + 1 {
+ a = a + i * j
+ }
+ }
+ a <=> 870
}
diff --git a/progs/tests/add.sy b/progs/tests/tuple/add.sy
index 3fadd86..3fadd86 100644
--- a/progs/tests/add.sy
+++ b/progs/tests/tuple/add.sy
diff --git a/progs/tests/tuples.sy b/progs/tests/tuple/basic.sy
index 642e381..642e381 100644
--- a/progs/tests/tuples.sy
+++ b/progs/tests/tuple/basic.sy
diff --git a/progs/tests/tuples_fail_invalid_singleton.sy b/progs/tests/tuple/fail_invalid_singleton.sy
index a8fafaa..a8fafaa 100644
--- a/progs/tests/tuples_fail_invalid_singleton.sy
+++ b/progs/tests/tuple/fail_invalid_singleton.sy
diff --git a/progs/tests/tuples_fail_out_of_bounds.sy b/progs/tests/tuple/fail_out_of_bounds.sy
index cb0764a..cb0764a 100644
--- a/progs/tests/tuples_fail_out_of_bounds.sy
+++ b/progs/tests/tuple/fail_out_of_bounds.sy
diff --git a/progs/tests/mul.sy b/progs/tests/tuple/mul.sy
index 4b33314..4b33314 100644
--- a/progs/tests/mul.sy
+++ b/progs/tests/tuple/mul.sy
diff --git a/progs/tests/more_types.sy b/progs/tests/tuple/multiple_types.sy
index c85403a..c85403a 100644
--- a/progs/tests/more_types.sy
+++ b/progs/tests/tuple/multiple_types.sy
diff --git a/progs/tests/sub.sy b/progs/tests/tuple/sub.sy
index cca4f2c..cca4f2c 100644
--- a/progs/tests/sub.sy
+++ b/progs/tests/tuple/sub.sy
diff --git a/progs/tests/types.sy b/progs/tests/tuple/types.sy
index bdcdfa4..bdcdfa4 100644
--- a/progs/tests/types.sy
+++ b/progs/tests/tuple/types.sy
diff --git a/sylt_macro/src/lib.rs b/sylt_macro/src/lib.rs
index 95b79c6..b6bf3b2 100644
--- a/sylt_macro/src/lib.rs
+++ b/sylt_macro/src/lib.rs
@@ -214,7 +214,7 @@ fn find_test_paths(directory: &Path) -> proc_macro2::TokenStream {
assert!(!path.to_str().unwrap().contains(","), "You should be ashamed.");
let path_string = path.to_str().unwrap();
- let test_name = format_ident!("file_{}", file_name.replace(".sy", ""));
+ let test_name = format_ident!("{}", file_name.replace(".sy", ""));
let settings = parse_test_settings(std::fs::read_to_string(path.clone()).unwrap());
let print = settings.print;