Commit Graph

167 Commits

Author SHA1 Message Date
Kayne Ruse
12c6ac938c WIP: tests incomplete 2024-11-30 12:50:46 +11:00
Kayne Ruse
58cecafb3b WIP: Adding arrays to value structure, tests incomplete 2024-11-29 12:17:54 +11:00
Kayne Ruse
bb2e85e350 Updated README.md 2024-11-29 12:16:10 +11:00
Kayne Ruse
431893bf60 WIP: Started on break & continue, needs Toy_Array in Toy_Value first 2024-11-28 13:43:26 +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
0947430c29 Finished if-then-else tests, finally. 2024-11-26 11:30:28 +11:00
Kayne Ruse
1695f9d1c9 Found and fixed a bug in the parser 2024-11-23 15:43:31 +11:00
Kayne Ruse
79c4374a1f Make sure this test works without scope braces too 2024-11-23 13:41:02 +11:00
Kayne Ruse
37fb3927a6 Implemented some tests, not finished yet
* parser compounds
* routine keyword assert
2024-11-23 10:45:19 +11:00
Kayne Ruse
0b559ecb74 Fixed the lines marked as 'URGENT' 2024-11-23 10:07:05 +11:00
Kayne Ruse
7d4ea4881f WIP: Fixed print bug, tests incomplete, read more
I was sidetracked by a strange display bug - turns out it was caused by
pointers - this commit fixes it.

The tests for if-then-else still aren't finished, but I'm knocking off
as it's past my time limit. I've marked 'TODO' and 'URGENT' using
comments, so finding the issues should be easy.
2024-11-22 18:21:47 +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
7398898a61 Added valgrind to the CI, fixed tests
This exposed an issue with my dev environment, which I had to patch.

Fixed #153
2024-11-17 18:49:40 +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
04f0653595 Planned control flow statements 2024-11-16 17:57:51 +11:00
Kayne Ruse
cd2113594d Fixed a call when using print keyword 2024-11-12 22:23:34 +11:00
Kayne Ruse
be7e4ddd18 Reworked the tests, read more
I've brought the tests up to scratch, except for compounds im the
parser, because I'm too damn tired to do that over SSH. It looks like
collections are right-recursive, whixh was unintended but still works
just fine.

I've also added the '--verbose' flag to the repl to control the
debugging output.

Several obscure bugs have been fixed, and comments have been tweaked.

Mustfail tests are still needed, but that's a low priority. See #142.

Fixed #151
2024-11-12 22:04:07 +11:00
Kayne Ruse
b74aa63c1c Added verbose debugging option to the REPL 2024-11-12 11:16:50 +11:00
Kayne Ruse
935993ee8a Adding discord webhook 2024-11-11 19:17:07 +11:00
Kayne Ruse
436bd3ffca Added silent cmd args
Fixed #145
2024-11-10 10:27:50 +11:00
Kayne Ruse
1608a13b43 Implemented assert keyword, read more
The assert keyword works, but I want to add a cmd option to suppress or
disable the errors.

The tests need some serious TLC. I know that, but I'm kicking it down
the road for now.
2024-11-09 17:41:29 +11:00
Kayne Ruse
1925d41940 Added indexing to strings, tests still needed 2024-11-09 13:10:54 +11:00
Kayne Ruse
5588986042 Tweaked file locations
Also altered the commit message, because there was a weird character in
it.
2024-11-03 12:10:39 +11:00
Kayne Ruse
32727f986c Benchmarked and tweaked Toy_Table, read more
I read the DOOM 1 source code and found a neat trick to replace modulo.

YOINK!!!
2024-11-02 21:29:13 +11:00
Kayne Ruse
92955d56dd Added a nice error message 2024-11-02 14:39:59 +11:00
Kayne Ruse
ef72415c21 Updated README 2024-11-02 11:52:54 +11:00
Kayne Ruse
7173f7770f Added types and constness
Fixed #144
2024-11-02 11:39:47 +11:00
Kayne Ruse
3ad53c5e0e Tweaked README 2024-10-31 14:54:46 +11:00
Kayne Ruse
3cb2132bfa Escaped characters stored in strings correctly
Fixed #147
2024-10-30 21:13:57 +11:00
Kayne Ruse
feab02e790 Fixed a test's return value
Only one platform caught this?
2024-10-30 21:00:02 +11:00
Kayne Ruse
163c8aa7f6 Fixed a printf format issue 2024-10-30 20:52:52 +11:00
Kayne Ruse
d19ca1bcee Reworked variable equality and comparisons
Fixed #146
2024-10-30 19:58:55 +11:00
Kayne Ruse
b30a092ab8 Added more reserved words 2024-10-27 18:07:52 +11:00
Kayne Ruse
e3bb7c0d25 Renamed a macro 2024-10-27 14:19:28 +11:00
Kayne Ruse
c5206daaea Implemented scopes 2024-10-27 13:44:09 +11:00
Kayne Ruse
d22b18ed17 Variable access is working 2024-10-26 10:35:47 +11:00
Kayne Ruse
2ee19c7c66 Automatically free container elements if needed 2024-10-26 09:45:22 +11:00
Kayne Ruse
3148a56ce0 Added simple assignment, read more
I was coding earlier this week, but my brain was so foggy I ended up not
knowing what I was doing. After a few days break, I've cleaned up the
mess, which took hours.

Changes:
* Variables can be assigned
* Added new value types as placeholders
* Added 'compare' and 'assign' to the AST
* Added duplicate opcode
* Added functions to copy and free values
* Max name length is 255 chars
* Compound assigns are squeezed into one word

To be completed:

* Tests for this commit's changes
* Compound assignments
* Variable access
2024-10-25 22:48:24 +11:00
Kayne Ruse
5b17c5e1e9 Comment tweak 2024-10-19 21:14:19 +11:00
Kayne Ruse
ddd91e389e Tweaked README blurb 2024-10-19 20:20:17 +11:00
Kayne Ruse
5d37d06343 Benchmarks are working, but empty
Lots of work and stress for a tint bit of progress.

See #131
2024-10-19 15:58:17 +11:00
Kayne Ruse
787a1cca84 Fixed table tests, ready for some benchmarking, see #131 2024-10-19 10:13:22 +11:00
Kayne Ruse
98ea0e5884 Reworking structures for easy testing, read more
I was reworking bits of the containers to address issue #131, then
realized that the table's tests depended on a specific initial size. I'm
too buggered to finish it tonight, so I'll fix it tomorrow.
2024-10-18 20:48:33 +11:00
Kayne Ruse
c3ee92fcef Arrays now store Toy_Values as elements
Fixed #136
2024-10-18 13:06:42 +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
425ef7e3e0 Moved keywords into the lexer 2024-10-14 12:41:53 +11:00
Kayne Ruse
694e262ee2 Tweaked 4-byte alignment function
Fixed #140

Thanks @8051enthusiast
2024-10-14 02:07:24 +11:00
Kayne Ruse
a51c5591ee Fixed declarations without initial value 2024-10-13 15:18:48 +11:00