diff options
Diffstat (limited to 'test-files/mds-kbdc/compile-layout')
20 files changed, 121 insertions, 0 deletions
diff --git a/test-files/mds-kbdc/compile-layout/invalid/macro-value_without_sideeffect b/test-files/mds-kbdc/compile-layout/invalid/macro-value_without_sideeffect new file mode 100644 index 0000000..a85e1b2 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/invalid/macro-value_without_sideeffect @@ -0,0 +1,5 @@ +macro m/0 + "a" +end macro +m() + diff --git a/test-files/mds-kbdc/compile-layout/invalid/nilreturning_function b/test-files/mds-kbdc/compile-layout/invalid/nilreturning_function new file mode 100644 index 0000000..f3518a4 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/invalid/nilreturning_function @@ -0,0 +1,4 @@ +function f/0 +end function +"\f()" : "" + diff --git a/test-files/mds-kbdc/compile-layout/invalid/value_without_sideeffect b/test-files/mds-kbdc/compile-layout/invalid/value_without_sideeffect new file mode 100644 index 0000000..8da2ae3 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/invalid/value_without_sideeffect @@ -0,0 +1,2 @@ +"a" + diff --git a/test-files/mds-kbdc/compile-layout/valid/do_not_shadow_variable_with_for b/test-files/mds-kbdc/compile-layout/valid/do_not_shadow_variable_with_for new file mode 100644 index 0000000..677735c --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/do_not_shadow_variable_with_for @@ -0,0 +1,5 @@ +let \1 : 0 +for 1 to 1 as \1 +end for +\1 : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/function-if-value-end-value b/test-files/mds-kbdc/compile-layout/valid/function-if-value-end-value new file mode 100644 index 0000000..0b90798 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/function-if-value-end-value @@ -0,0 +1,10 @@ +# It is acceptable not to find unneccessary statements + +function f/0 + if 1 + "a" + end if + "a" +end function +<letter \f()> : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/function-value-if-value b/test-files/mds-kbdc/compile-layout/valid/function-value-if-value new file mode 100644 index 0000000..a9f2394 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/function-value-if-value @@ -0,0 +1,8 @@ +function f/0 + "a" + if 1 + "a" + end if +end function +<letter \f()> : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/function-value-if-value-end-value b/test-files/mds-kbdc/compile-layout/valid/function-value-if-value-end-value new file mode 100644 index 0000000..3d8644a --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/function-value-if-value-end-value @@ -0,0 +1,11 @@ +# It is acceptable not to find unneccessary statements + +function f/0 + "a" + if 1 + "a" + end if + "a" +end function +<letter \f()> : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/function-value-value b/test-files/mds-kbdc/compile-layout/valid/function-value-value new file mode 100644 index 0000000..71a282e --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/function-value-value @@ -0,0 +1,6 @@ +function f/0 + "a" + "a" +end function +<letter \f()> : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/identity_function b/test-files/mds-kbdc/compile-layout/valid/identity_function new file mode 100644 index 0000000..0cd4371 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/identity_function @@ -0,0 +1,5 @@ +function id/1 + \1 +end function +<letter \id("a")> : "\id("a")" + diff --git a/test-files/mds-kbdc/compile-layout/valid/let-function-end-nonshadowing_for b/test-files/mds-kbdc/compile-layout/valid/let-function-end-nonshadowing_for new file mode 100644 index 0000000..8bae30b --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/let-function-end-nonshadowing_for @@ -0,0 +1,7 @@ +let \1 : 0 +function f/0 +end function +for "a" to "a" as \1 +end for +\1 : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/let-function-shadowing_for b/test-files/mds-kbdc/compile-layout/valid/let-function-shadowing_for new file mode 100644 index 0000000..1086217 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/let-function-shadowing_for @@ -0,0 +1,7 @@ +let \1 : "" +function f/0 + for 0 to 0 as \1 + end for +end function +\1 : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/macro_1 b/test-files/mds-kbdc/compile-layout/valid/macro_1 new file mode 100644 index 0000000..3d7323d --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/macro_1 @@ -0,0 +1,5 @@ +macro m/1 + <letter \1> : \1 +end macro +m("a") + diff --git a/test-files/mds-kbdc/compile-layout/valid/map_with_function_call b/test-files/mds-kbdc/compile-layout/valid/map_with_function_call new file mode 100644 index 0000000..f85ef2b --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/map_with_function_call @@ -0,0 +1,5 @@ +function f/0 + "a" +end function +<letter \f()> : "\f()" + diff --git a/test-files/mds-kbdc/compile-layout/valid/override_variable b/test-files/mds-kbdc/compile-layout/valid/override_variable new file mode 100644 index 0000000..30d0bdb --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/override_variable @@ -0,0 +1,3 @@ +let \4 : { 0 } +let \4 : { 0 0 } + diff --git a/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_for b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_for new file mode 100644 index 0000000..37ea0c3 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_for @@ -0,0 +1,7 @@ +let \1 : "a" +function f/0 + for 0 to 0 as \1 + end for +end function +\1 : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_function_call b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_function_call new file mode 100644 index 0000000..b858438 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_function_call @@ -0,0 +1,7 @@ +let \1 : "a" +function f/1 + "" +end function +"" : "\f(0)" +\1 : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_let b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_let new file mode 100644 index 0000000..a19cc88 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_let @@ -0,0 +1,9 @@ +let \1 : "a" +function f/0 + let \1 : "b" +end function +if \equals(\1 "b") + let \1 : 0 +end if +\1 : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_macro_call b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_macro_call new file mode 100644 index 0000000..6352d0d --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/shadow_variable_with_macro_call @@ -0,0 +1,6 @@ +let \1 : "a" +macro m/1 +end macro +m(0) +\1 : "" + diff --git a/test-files/mds-kbdc/compile-layout/valid/value_with_indirect_sideeffect b/test-files/mds-kbdc/compile-layout/valid/value_with_indirect_sideeffect new file mode 100644 index 0000000..24c9f5b --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/value_with_indirect_sideeffect @@ -0,0 +1,6 @@ +let \4 : { 0 } +function xset/3 + "\set(\1 \2 \3)" +end function +"\xset(4 0 0)" + diff --git a/test-files/mds-kbdc/compile-layout/valid/value_with_sideeffect b/test-files/mds-kbdc/compile-layout/valid/value_with_sideeffect new file mode 100644 index 0000000..2c0f982 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/value_with_sideeffect @@ -0,0 +1,3 @@ +let \1 : { 0 } +"\set(1 0 0)" + |