From e85b818023fe409468b9802ce2923b5f26974bc4 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 31 Jan 2017 18:12:14 +0100 Subject: Move test files to separate folder --- block.nl | 10 ---------- fibo.nl | 35 ----------------------------------- nl/block.nl | 10 ++++++++++ nl/fibo.nl | 35 +++++++++++++++++++++++++++++++++++ nl/puts.nl | 9 +++++++++ nl/simple.nl | 20 ++++++++++++++++++++ nl/test.nl | 19 +++++++++++++++++++ nl/test_string.nl | 17 +++++++++++++++++ puts.nl | 9 --------- simple.nl | 20 -------------------- test.nl | 19 ------------------- test_string.nl | 17 ----------------- 12 files changed, 110 insertions(+), 110 deletions(-) delete mode 100644 block.nl delete mode 100644 fibo.nl create mode 100644 nl/block.nl create mode 100644 nl/fibo.nl create mode 100644 nl/puts.nl create mode 100644 nl/simple.nl create mode 100644 nl/test.nl create mode 100644 nl/test_string.nl delete mode 100644 puts.nl delete mode 100644 simple.nl delete mode 100644 test.nl delete mode 100644 test_string.nl diff --git a/block.nl b/block.nl deleted file mode 100644 index c9052d6..0000000 --- a/block.nl +++ /dev/null @@ -1,10 +0,0 @@ -i32 main(){ - i32 kaas = 1; - i32 piet = 2; - print(kaas + 3); - i64 nogwat = 3; - if(kaas == 1){ - print(piet); - i32 x = 10; - } -} \ No newline at end of file diff --git a/fibo.nl b/fibo.nl deleted file mode 100644 index ac12c2d..0000000 --- a/fibo.nl +++ /dev/null @@ -1,35 +0,0 @@ -type int = i32; -type char = i8; - -extern func void(int) putchar; - -void printnum(int n){ - if(n==0){ - putchar('0'); - putchar('\n'); - return; - } - if(n<0){ - putchar('-'); - n=-n; - } - while(n>0){ - putchar('0'+n%10); - n=n/10; - } - putchar('\n'); - return; -} - -int main(){ - int a=0; - int b=1; - int i=0; - while(i<=10){ - printnum(b); - b=a+b; - a=b-a; - i=i+1; - } - return 0; -} diff --git a/nl/block.nl b/nl/block.nl new file mode 100644 index 0000000..c9052d6 --- /dev/null +++ b/nl/block.nl @@ -0,0 +1,10 @@ +i32 main(){ + i32 kaas = 1; + i32 piet = 2; + print(kaas + 3); + i64 nogwat = 3; + if(kaas == 1){ + print(piet); + i32 x = 10; + } +} \ No newline at end of file diff --git a/nl/fibo.nl b/nl/fibo.nl new file mode 100644 index 0000000..ac12c2d --- /dev/null +++ b/nl/fibo.nl @@ -0,0 +1,35 @@ +type int = i32; +type char = i8; + +extern func void(int) putchar; + +void printnum(int n){ + if(n==0){ + putchar('0'); + putchar('\n'); + return; + } + if(n<0){ + putchar('-'); + n=-n; + } + while(n>0){ + putchar('0'+n%10); + n=n/10; + } + putchar('\n'); + return; +} + +int main(){ + int a=0; + int b=1; + int i=0; + while(i<=10){ + printnum(b); + b=a+b; + a=b-a; + i=i+1; + } + return 0; +} diff --git a/nl/puts.nl b/nl/puts.nl new file mode 100644 index 0000000..4379916 --- /dev/null +++ b/nl/puts.nl @@ -0,0 +1,9 @@ +type int = i32; +type char = i8; + +extern func int(ptr(char)) puts; + +int main(){ + puts("kaas!"); + return 0; +} \ No newline at end of file diff --git a/nl/simple.nl b/nl/simple.nl new file mode 100644 index 0000000..699fec2 --- /dev/null +++ b/nl/simple.nl @@ -0,0 +1,20 @@ +type int = i32; +type char = i8; + +int g_var; + +int main(i32 argc, ptr(ptr(i8)) argv) { + //int i = g_var; + int i = 40; + //i = g_var + 2 + 3; + int a = i + 2; + if (a == 41) { + return 10; + } else { + a = 20; + } + while (a < 42) { + a = a + 1; + } + return a; +} diff --git a/nl/test.nl b/nl/test.nl new file mode 100644 index 0000000..5e23bf3 --- /dev/null +++ b/nl/test.nl @@ -0,0 +1,19 @@ +type int = i32; +type char = i8; + +int glob; + +int main(int argc, ptr(char) argv) { + glob = 10; + int kaas = glob + 2; + glob = 2 > 1 || 1 == 1 % 10; + while (glob < 20) { + if (kaas == 12) glob = glob + 3 / 2; + else glob = glob - 1; + if (glob < -10) return glob; + if (glob < -12) { + return glob; + } else {} + } + return kaas; +} diff --git a/nl/test_string.nl b/nl/test_string.nl new file mode 100644 index 0000000..ccba9a1 --- /dev/null +++ b/nl/test_string.nl @@ -0,0 +1,17 @@ +type int = i32; +type char = i8; +type string = ptr(char); + +extern func void(int) putchar; + +void f(char c) { + putchar(c); + return; +} + +int main(int argc, ptr(string) argv) { + string s = "kaas"; + ptr(i8) s2 = "kaas2"; + f('x'); + return 0; +} diff --git a/puts.nl b/puts.nl deleted file mode 100644 index 4379916..0000000 --- a/puts.nl +++ /dev/null @@ -1,9 +0,0 @@ -type int = i32; -type char = i8; - -extern func int(ptr(char)) puts; - -int main(){ - puts("kaas!"); - return 0; -} \ No newline at end of file diff --git a/simple.nl b/simple.nl deleted file mode 100644 index 699fec2..0000000 --- a/simple.nl +++ /dev/null @@ -1,20 +0,0 @@ -type int = i32; -type char = i8; - -int g_var; - -int main(i32 argc, ptr(ptr(i8)) argv) { - //int i = g_var; - int i = 40; - //i = g_var + 2 + 3; - int a = i + 2; - if (a == 41) { - return 10; - } else { - a = 20; - } - while (a < 42) { - a = a + 1; - } - return a; -} diff --git a/test.nl b/test.nl deleted file mode 100644 index 5e23bf3..0000000 --- a/test.nl +++ /dev/null @@ -1,19 +0,0 @@ -type int = i32; -type char = i8; - -int glob; - -int main(int argc, ptr(char) argv) { - glob = 10; - int kaas = glob + 2; - glob = 2 > 1 || 1 == 1 % 10; - while (glob < 20) { - if (kaas == 12) glob = glob + 3 / 2; - else glob = glob - 1; - if (glob < -10) return glob; - if (glob < -12) { - return glob; - } else {} - } - return kaas; -} diff --git a/test_string.nl b/test_string.nl deleted file mode 100644 index ccba9a1..0000000 --- a/test_string.nl +++ /dev/null @@ -1,17 +0,0 @@ -type int = i32; -type char = i8; -type string = ptr(char); - -extern func void(int) putchar; - -void f(char c) { - putchar(c); - return; -} - -int main(int argc, ptr(string) argv) { - string s = "kaas"; - ptr(i8) s2 = "kaas2"; - f('x'); - return 0; -} -- cgit v1.2.3-70-g09d2