Commit Graph

7 Commits

Author SHA1 Message Date
Kayne Ruse
ff13b5cf38 Implemented print keyword and associated tests 2024-10-07 12:13:06 +11:00
Kayne Ruse
d19a90f9bd Added CONTRIBUTING.md
Also renamed 'handles' throughout the project for consistency.

Some meta files also had their file extensions added.
2024-10-05 12:17:27 +10:00
Kayne Ruse
ab1c9b941f Added negate opcode to equality opcode, in the second byte 2024-10-03 10:15:58 +10:00
Kayne Ruse
7b453bc35f Reworked generic structures, read more
The following structures are now more independant:

- Toy_Array
- Toy_Stack
- Toy_Bucket
- Toy_String

I reworked a lot of the memory allocation, so now there are more direct
calls to malloc() or realloc(), rather than relying on the macros from
toy_memory.h.

I've also split toy_memory into proper array and bucket files, because
it makes more sense this way, rather than having them both jammed into
one file. This means the eventual hashtable structure can also stand on
its own.

Toy_Array is a new wrapper around raw array pointers, and all of the
structures have their metadata embedded into their allocated memory now,
using variable length array members.

A lot of 'capacity' and 'count' variables were changed to 'size_t'
types, but this doesn't seem to be a problem anywhere.

If the workflow fails, then I'll leave it for tonight - I'm too tired,
and I don't want to overdo myself.
2024-10-01 20:38:06 +10:00
Kayne Ruse
8d6bdb88b4 Implemented and tested Toy_String, read more
Strings are needed for the handling of identifiers in the key/value
variable storage, so I've got them working first. I used the rope
pattern, which seems to be quite an interesting approach.

I'll add comparison checks later.

Adjusted how buckets are handled in all tests, could've been an issue
down the line.

Added the build instructions to README.md.
2024-09-30 15:22:00 +10:00
Kayne Ruse
a2625fa6d4 Implemented tests for Toy_Bytecode and Toy_Routine 2024-09-22 14:13:50 +10:00
Kayne Ruse
ad6f1c3067 Bytecode and Routine working, Routine tests incomplete
There may be a build issue on windows
2024-09-20 16:22:52 +10:00