Commit Graph

11 Commits

Author SHA1 Message Date
283eaa1ebe Add index assignment and augmented assignment
This allows for syntax like `foo['a'] = 1` and more complex assignments
like `foo.bar()[a() + b()] += 1`

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-10-18 22:03:10 -07:00
e8461cd58b Add map tests
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-10-15 19:02:55 -07:00
17408a8695 Implement import a, b, c from foo syntax
This brings stuff into the local scope, but it is a little funky with
local scopes that are above the current level (in the same function or
module).

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-10-04 20:12:21 -07:00
c176efb13a Add some tests for modules
* .gitignore now ignores *.got for *anything* under the tests/ directory
* runtests.sh ignores files in the tests/ directory that have the string
  "test_import_" in them, so they are not run as tests themselves
* Add a couple of basic module functionality tests

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-10-04 11:11:46 -07:00
a7d7d8e564 Add List.extend and List.to_list, plus some more tests
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-30 19:53:31 -07:00
8d1cd710b0 Add tests for string indexing and converting lists to strings
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-30 17:36:36 -07:00
724a6b6f99 Add Nil constructor and tests
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-30 12:48:45 -07:00
3d0da0ec85 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>
2024-09-30 12:43:02 -07:00
1dd058ae18 Add binary and hex number parsing
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-26 10:03:54 -07:00
0d126b8ba3 Add FloatInst method implementations and tests
FloatInst should be fully implemented now and have a suite of tests to
make sure those methods are doing what they should be.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-26 09:03:13 -07:00
f020155453 Add integration tests
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-25 11:42:51 -07:00