Commit Graph

7 Commits

Author SHA1 Message Date
Kayne Ruse
547229e150 Script tests re-added, all tests can run under gdb
Also fixed a minor bug with printing, and removed the ability to
configure the parser.

Added and updated QUICKSTART.md as a quick way to get people started.

There's some broken scripts under 'scripts/' that require functions to
work properly.
2026-04-10 15:28:56 +10:00
Kayne Ruse
fbb7e1bc54 WIP: Retreived the unit tests (formerly test cases)
Some of these still work, others have just been dummied out for now.

Also added tests for console colors tool, and tweaked it to work
properly.
2026-04-05 18:42:56 +10:00
Kayne Ruse
ba9418f365 Removed unneeded files and console colors are disabled 2026-04-04 20:35:12 +11:00
Kayne Ruse
bfed4e23f3 Repl works, also fixed a few small bugs 2025-01-31 10:16:06 +11:00
Kayne Ruse
14653a303f Added 'Toy_String' to 'Toy_Value' structure, read more
To help with storing strings within tables, I've replaced the unused
'_padding' member of 'Toy_String' with 'cachedHash', which is set to
zero on string allocation.

The hash of a string isn't generated and stored until it's actually
needed, as the rope pattern means not every string needs a hash -
hopefully this will save unnecessarily wasted time.

When a hash of a string is needed, the hashing function first checks to
see if that string already has one, and if so, returns it. Again, less
time wasted.

When generating a new string hash, the hashing function takes the
string's type into account, as node-based strings first need their
contents assembled into a simple char buffer.

Other changes include:

* Changed 'TOY_VALUE_TO_*' to 'TOY_VALUE_FROM_*'
* Changed 'TOY_VALUE_IS_EQUAL' to 'TOY_VALUES_ARE_EQUAL'
* Added a missing '#pragma once' to 'toy_print.h'
2024-10-07 17:35:31 +11:00
Kayne Ruse
5fd933a15e Implemented AST, ensured bucket memory worked 2024-09-10 20:25:01 +10:00
Kayne Ruse
a912b6a29c Added lexer, implemented tests build system 2024-08-11 20:15:09 +10:00