Add do_call macro, implement Bool builtins, add tests

* I noticed that `fn call(...)` in all objects was identical, so I made
  a macro for it. This should make things a little easier to read, since
  do_call is about 30 lines a pop.
* Bool has a constructor now, and a to_int and to_float implementations
* Add tests for constructors and add new bool tests

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2024-09-30 12:41:13 -07:00
parent b9429d7c19
commit 3d0da0ec85
10 changed files with 240 additions and 78 deletions

View File

@@ -128,3 +128,12 @@ println(-0.0)
println(--0.0)
println(---0.0)
# constructor
println("constructor")
println(Float("10"))
println(Float("10e3"))
println(Float("12e-3"))
println(Float(1234))
println(Float(1.5))
println(Float(true))
println(Float(false))