Commit Graph

23 Commits

Author SHA1 Message Date
Kayne Ruse
5f75b5f1a3 Allowed for empty arrays and trailing commas 2024-12-10 10:44:13 +11:00
Kayne Ruse
1a36c14247 Expanded array tests, read more
Getting the array's length is still not available yet, so I'm not
marking arrays as done - but everything that is there is tested.

I've also tweaked the assert output callbacks to also print 'assert failure'.
2024-12-09 12:11:31 +11:00
Kayne Ruse
61a105db2d Compound assignment for arrays is working, untested, read more
I added reference values in 62ca7a1fb7,
but forgot to mention it. I'm now using references to assign to the
internals of an array, no matter how many levels deep it is.
2024-12-07 15:35:06 +11:00
Kayne Ruse
62ca7a1fb7 WIP: Implementing arrays into the script, read more
I had intended to solve the Advent of Code puzzles in Toy, but they
don't work without arrays. I wasn't able to enable arrays in time, so
I need to focus on doing things correctly.

The most immediate tasks are marked with 'URGENT', and a lot of tests
need writing.
2024-12-02 11:58:03 +11:00
Kayne Ruse
bb2e85e350 Updated README.md 2024-11-29 12:16:10 +11:00
Kayne Ruse
6cc331d462 While is working but untested, read more
* TODO: break and continue keywords need to be implemented
* TODO: while-then needs testing
* Fixed the parser not liking zero-length strings
2024-11-26 14:48:24 +11:00
Kayne Ruse
0b559ecb74 Fixed the lines marked as 'URGENT' 2024-11-23 10:07:05 +11:00
Kayne Ruse
b29a87840d EMERGENCY: Computer is dying, this is an incomplete commit, do not use 2024-11-22 15:48:44 +11:00
Kayne Ruse
b2b2ca7e53 If-then-else is working, untested 2024-11-20 12:50:27 +11:00
Kayne Ruse
34577ecfe1 WIP: if-then-else, incomplete 2024-11-19 17:14:39 +11:00
Kayne Ruse
2f9489d5fd Fixed a 'malformed assignment' issue, read more
I've also added some support for compiler errors in general, but these
will get expanded on later.

I've also quickly added a valgrind option to the tests and found a few
leaks. I'll deal with these later.

Summary of changes:

* Clarified the lifetime of the bytecode in memory
* Erroneous routines exit without compiling
* Empty VMs don't run
* Added a check for malformed assignments
* Renamed "routine" to "module" within the VM
* VM no longer tries to free the bytecode - must be done manually
* Started experimenting with valgrind, not yet ready
2024-11-16 21:02:37 +11:00
Kayne Ruse
b74aa63c1c Added verbose debugging option to the REPL 2024-11-12 11:16:50 +11:00
Kayne Ruse
7173f7770f Added types and constness
Fixed #144
2024-11-02 11:39:47 +11:00
Kayne Ruse
3cb2132bfa Escaped characters stored in strings correctly
Fixed #147
2024-10-30 21:13:57 +11:00
Kayne Ruse
d19ca1bcee Reworked variable equality and comparisons
Fixed #146
2024-10-30 19:58:55 +11:00
Kayne Ruse
c5206daaea Implemented scopes 2024-10-27 13:44:09 +11:00
Kayne Ruse
09e4cb7b03 Squashed: Added integration and standalone tests, read more
This wasn't an easy fix, as it was primarily the test pipelines that
were failing. I resorted to using forced pushes to run the CI, to try
and track down the problems.

The primary cause seems to be the differences in how each supported
platform handles file paths, specifically, slash vs. backslash.

I've also added gdb scripts to set up automated breakpoints, and to run
operations on them to check for issues - the 'gdb_init' files are mostly
empty for the time being.

commit a34b0ff5d407bbe7d70ff9504aa035ec6fbecb7c
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Oct 18 11:45:40 2024 +1100

    Restored the workflows

commit eb3d94f30d4dc4150139517f44cc874f2901124f
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Oct 18 11:35:39 2024 +1100

    I think the library path on macos is fixed

commit 964572b5e93c7cb464686f19ddbe3e9d315f391b
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Oct 18 11:22:56 2024 +1100

    I think the file paths are fixed

commit 1721f3da7252b4063f4347926e800ef4f7c9bf4c
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Thu Oct 17 15:57:28 2024 +1100

    Added standalone tests

commit 90c783f4059d88f4a7bbaf18215a9b414f3ab66f
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Thu Oct 17 15:01:18 2024 +1100

    Trying to fix the integration test pipeline

commit fccced1396568a55c1385e2f1b04fedf7c2585a5
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Wed Oct 16 00:31:39 2024 +1100

    Workflow integration tests are not passing

commit 6b1e0d1e0f89291e89768bf6102f4f7ed4581496
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Tue Oct 15 20:07:20 2024 +1100

    Fixed file paths in workflow

commit c0f1ec78fe79a5abb34c3e05308236cb18c23b97
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Tue Oct 15 19:46:14 2024 +1100

    Moved example scripts into proper integration tests

    Also adjusted makefiles to allow easy invoking of the tests.

    Adjusted and updated CI to invoke tests correctly.

    Fixed #141
2024-10-18 12:04:29 +11:00
Kayne Ruse
a51c5591ee Fixed declarations without initial value 2024-10-13 15:18:48 +11:00
Kayne Ruse
80734563b9 Implemented and tested variable declaration
Assignment, etc. is still to come, as are types.
2024-10-13 15:02:42 +11:00
Kayne Ruse
4bcf8e84a9 String literals are being parsed, compiled and printed, read more
Strings, due to their potentially large size, are stored outside of a
routine's code section, in the data section. To access the correct
string, you must read the jump index, then the real address from the
jump table - and extra layer of indirection will result in more flexible
data down the road, I hope.

Other changes include:

* Added string concat operator ..
* Added TOY_STRING_MAX_LENGTH
* Strings can't be created or concatenated longer than the max length
* The parser will display a warning if the bucket is too small for a
  string at max length, but it will continue
* Added TOY_BUCKET_IDEAL to correspend with max string length
* The bucket now allocates an address that is 4-byte aligned
* Fixed missing entries in the parser rule table
* Corrected some failing TOY_BITNESS tests
2024-10-08 00:33:36 +11:00
Kayne Ruse
ff13b5cf38 Implemented print keyword and associated tests 2024-10-07 12:13:06 +11:00
Kayne Ruse
57fb1ece81 Basic infile reading is working, untested 2024-09-28 12:26:42 +10:00
Kayne Ruse
5fd933a15e Implemented AST, ensured bucket memory worked 2024-09-10 20:25:01 +10:00