Adds type infrastructure.

Only floats (nums) are available at the moment.
This commit is contained in:
2025-02-08 11:01:56 -05:00
parent 67f659e263
commit 40b91b96bd
6 changed files with 65 additions and 49 deletions

View File

@@ -113,7 +113,19 @@ bin() { ./scl.out $1 | tail -n1; }
# [ "$output" = "= 4.000000" ]
#}
@test "integer arithmetic" {
@test "type stuff" {
run bin "x:int=1"
[ "$output" = "= 1" ]
run bin "x=1.5; type(x)"
[ "$output" = "= num"]
run bin "x:int=1.5; type(x)"
[ "$output" = "= int" ]
run bin "x:int=1.5"
[ "$output" = "= 1" ]
run bin "print(\"Hello, world!\")"
[ "$output" = "= Hello, world!" ]
}