quite a few fixes, overall repo cleanup and some restructurization in the stdlib
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
42
|
||||
3
|
||||
@@ -1,16 +0,0 @@
|
||||
import ../stdlib/stdlib.sl
|
||||
import ../stdlib/io.sl
|
||||
import ../fn.sl
|
||||
|
||||
word main
|
||||
2 40 +
|
||||
puti cr
|
||||
extend-syntax
|
||||
foo(1, 2)
|
||||
puti cr
|
||||
0
|
||||
end
|
||||
|
||||
fn foo(int a, int b){
|
||||
return a + b;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
python main.py tests/call_syntax_parens.sl -o /tmp/call_syntax_parens > /dev/null && /tmp/call_syntax_parens
|
||||
@@ -30,4 +30,3 @@
|
||||
111
|
||||
222
|
||||
16
|
||||
70
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import ../stdlib/stdlib.sl
|
||||
import ../stdlib/io.sl
|
||||
import ../fn.sl
|
||||
|
||||
:asm mem-slot {
|
||||
lea rax, [rel print_buf]
|
||||
@@ -33,12 +32,6 @@ struct: Point
|
||||
field y 8
|
||||
;struct
|
||||
|
||||
extend-syntax
|
||||
|
||||
fn fancy_add(int a, int b){
|
||||
return (a + b) * b;
|
||||
}
|
||||
|
||||
word test-add
|
||||
5 7 + puti cr
|
||||
end
|
||||
@@ -161,13 +154,6 @@ word test-cmp
|
||||
4 5 >= puti cr
|
||||
end
|
||||
|
||||
word test-c-fn
|
||||
3
|
||||
7
|
||||
fancy_add()
|
||||
puti cr
|
||||
end
|
||||
|
||||
word main
|
||||
test-add
|
||||
test-sub
|
||||
@@ -186,6 +172,5 @@ word main
|
||||
test-for-zero
|
||||
test-cmp
|
||||
test-struct
|
||||
test-c-fn
|
||||
0
|
||||
end
|
||||
|
||||
4
tests/str.expected
Normal file
4
tests/str.expected
Normal file
@@ -0,0 +1,4 @@
|
||||
1
|
||||
g
|
||||
g
|
||||
hello world hello world hello world hello world hello world
|
||||
15
tests/str.sl
Normal file
15
tests/str.sl
Normal file
@@ -0,0 +1,15 @@
|
||||
import stdlib.sl
|
||||
|
||||
word main
|
||||
"g" "g"
|
||||
strcmp
|
||||
puti cr
|
||||
puts
|
||||
puts
|
||||
|
||||
"hello world hello world hello " "world hello world hello world"
|
||||
strconcat
|
||||
2dup
|
||||
puts
|
||||
free
|
||||
end
|
||||
1
tests/str.test
Normal file
1
tests/str.test
Normal file
@@ -0,0 +1 @@
|
||||
python main.py tests/str.sl -o /tmp/str > /dev/null && /tmp/str
|
||||
2
tests/typeconversion.expected
Normal file
2
tests/typeconversion.expected
Normal file
@@ -0,0 +1,2 @@
|
||||
1235
|
||||
1235
|
||||
9
tests/typeconversion.sl
Normal file
9
tests/typeconversion.sl
Normal file
@@ -0,0 +1,9 @@
|
||||
import stdlib.sl
|
||||
|
||||
word main
|
||||
"1234" toint 1 + dup puti cr
|
||||
tostr
|
||||
2dup
|
||||
puts
|
||||
free
|
||||
end
|
||||
1
tests/typeconversion.test
Normal file
1
tests/typeconversion.test
Normal file
@@ -0,0 +1 @@
|
||||
python main.py tests/typeconversion.sl -o /tmp/typeconversion > /dev/null && /tmp/typeconversion
|
||||
@@ -1 +0,0 @@
|
||||
7
|
||||
@@ -1,12 +0,0 @@
|
||||
import ../stdlib/stdlib.sl
|
||||
import ../stdlib/io.sl
|
||||
|
||||
word add-two
|
||||
+
|
||||
end
|
||||
|
||||
word main
|
||||
3 4 add-two
|
||||
puti cr
|
||||
0
|
||||
end
|
||||
@@ -1 +0,0 @@
|
||||
python main.py tests/word_syntax.sl -o /tmp/word_syntax > /dev/null && /tmp/word_syntax
|
||||
Reference in New Issue
Block a user