From 58d10b17ca767635b1e38cb2e57d07438478571b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 Dec 2014 01:16:09 +0100 Subject: mds-kbdc: compile-layout: m bug fix + more test cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .../mds-kbdc/compile-layout/invalid/call_function_as_macro | 4 ++++ .../mds-kbdc/compile-layout/invalid/call_macro_as_function | 4 ++++ .../mds-kbdc/compile-layout/valid/overloaded_builtin_function | 7 +++++++ test-files/mds-kbdc/compile-layout/valid/overloaded_function | 10 ++++++++++ test-files/mds-kbdc/compile-layout/valid/overloaded_macro | 9 +++++++++ .../mds-kbdc/compile-layout/valid/samenamed_macro_and_function | 8 ++++++++ 6 files changed, 42 insertions(+) create mode 100644 test-files/mds-kbdc/compile-layout/invalid/call_function_as_macro create mode 100644 test-files/mds-kbdc/compile-layout/invalid/call_macro_as_function create mode 100644 test-files/mds-kbdc/compile-layout/valid/overloaded_builtin_function create mode 100644 test-files/mds-kbdc/compile-layout/valid/overloaded_function create mode 100644 test-files/mds-kbdc/compile-layout/valid/overloaded_macro create mode 100644 test-files/mds-kbdc/compile-layout/valid/samenamed_macro_and_function (limited to 'test-files/mds-kbdc') diff --git a/test-files/mds-kbdc/compile-layout/invalid/call_function_as_macro b/test-files/mds-kbdc/compile-layout/invalid/call_function_as_macro new file mode 100644 index 0000000..deedfd1 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/invalid/call_function_as_macro @@ -0,0 +1,4 @@ +function f/0 +end function +f() + diff --git a/test-files/mds-kbdc/compile-layout/invalid/call_macro_as_function b/test-files/mds-kbdc/compile-layout/invalid/call_macro_as_function new file mode 100644 index 0000000..b4a90c2 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/invalid/call_macro_as_function @@ -0,0 +1,4 @@ +macro m/0 +end macro +"" : "\m()" + diff --git a/test-files/mds-kbdc/compile-layout/valid/overloaded_builtin_function b/test-files/mds-kbdc/compile-layout/valid/overloaded_builtin_function new file mode 100644 index 0000000..e13d291 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/overloaded_builtin_function @@ -0,0 +1,7 @@ +function add/3 + \add(\1 \add(\2 \3)) +end function +if \not(\equals(\add(1 2 3) 6)) + "" : 0 +end if + diff --git a/test-files/mds-kbdc/compile-layout/valid/overloaded_function b/test-files/mds-kbdc/compile-layout/valid/overloaded_function new file mode 100644 index 0000000..70bc5b0 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/overloaded_function @@ -0,0 +1,10 @@ +function f/0 + 1 +end function +function f/1 + \1 +end function +if \equals(\f() \f(2)) + "" : 0 +end if + diff --git a/test-files/mds-kbdc/compile-layout/valid/overloaded_macro b/test-files/mds-kbdc/compile-layout/valid/overloaded_macro new file mode 100644 index 0000000..d9bdd41 --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/overloaded_macro @@ -0,0 +1,9 @@ +macro m/1 + "" : \1 +end macro +macro m/2 + \add(1 \1) : 2 +end macro +m(1) +m(0 1) + diff --git a/test-files/mds-kbdc/compile-layout/valid/samenamed_macro_and_function b/test-files/mds-kbdc/compile-layout/valid/samenamed_macro_and_function new file mode 100644 index 0000000..8703e7a --- /dev/null +++ b/test-files/mds-kbdc/compile-layout/valid/samenamed_macro_and_function @@ -0,0 +1,8 @@ +function c/0 + "a" +end function +macro c/0 + \c() : \c() +end macro +c() + -- cgit v1.2.3-70-g09d2