Compare commits

..

6 Commits

Author SHA1 Message Date
Kayne Ruse b602e2ff87 Tweaked build trigger 2024-09-22 15:04:27 +10:00
Kayne Ruse 0b99eb7b0c Bumped patch version 2024-09-22 14:45:04 +10:00
Kayne Ruse 2505cedc79 Update README.md 2024-09-22 14:43:20 +10:00
Kayne Ruse d7035a59c8 Updated CI 2024-08-11 21:25:11 +10:00
Kayne Ruse ea584d8950 Fixed the failing build on mingw
Squashed commit of the following:

commit c48929d25a84331ca8bd1b27be2c6aa4f3b4db12
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Aug 9 23:12:49 2024 +1000

    Update c-cpp.yml

    I'm only going a little bit nuts.

commit 3f65882bdc75f1712c9a3c9d2ddf0e53a27ce4b9
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Aug 9 22:49:18 2024 +1000

    Update c-cpp.yml

    It would be great if this was documented better.

commit d3abeda7c2776bb2e82ca635cd659967afa6ad75
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Aug 9 21:40:39 2024 +1000

    Bumped license date

commit 17bbce9d7ca212064bc95e467933c5602a89fb4c
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Aug 9 21:33:57 2024 +1000

    Fixed the failing build on mingw

    There seems to be persistent issues with different compilers
    displaying the values of size_t, so I simply cast it to an integer.

commit 843a76d0ac44328776f8ecf83a66caa7ea7fdef6
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Aug 9 21:17:17 2024 +1000

    Updated CI

commit 08cd89c58d8d028438b9f83a60f5dd9265cc3465
Author: Kayne Ruse <kayneruse@gmail.com>
Date:   Fri Aug 9 21:09:03 2024 +1000

    Why did that fail last time?
2024-08-09 23:25:56 +10:00
Kayne Ruse 2ce9a0cf42 Fixed an AST bug 2024-07-20 16:27:07 +10:00
8 changed files with 29 additions and 20 deletions
@@ -1,17 +1,26 @@
name: Comprehensive Tests
name: Continuous Integration v1.x
#trigger when these occur
on:
push:
branches: [ "main", "dev" ]
branches:
- v1
pull_request:
branches: [ "main" ]
types:
- opened
- edited
- reopened
branches:
- v1
workflow_dispatch:
#testing the CI workflows under multiple supported conditions
jobs:
test-valgrind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install valgrind
run: sudo apt install valgrind
- name: make test (valgrind)
@@ -21,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: make test (sanitized)
run: make test-sanitized
@@ -29,6 +38,6 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: make test (mingw32)
run: make test
+1 -1
View File
@@ -1,6 +1,6 @@
# License
Copyright (c) 2020-2023 Kayne Ruse, KR Game Studios
Copyright (c) 2020-2024 Kayne Ruse, KR Game Studios
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+2 -2
View File
@@ -2,7 +2,7 @@
<image src="toylogo.png" />
</p>
# Toy
# Toy v1
The Toy programming language is an imperative bytecode-intermediate embedded scripting language. It isn't intended to operate on its own, but rather as part of another program, the "host". This process is intended to allow a decent amount of easy customisation by the host's end user, by exposing logic in script files. Alternatively, binary files in a custom format can be used as well.
@@ -83,4 +83,4 @@ Unnamed Individuals - Feedback
* Seth A. Robinson
Special thanks to http://craftinginterpreters.com/ for their fantastic book that set me on this path.
Special thanks to http://craftinginterpreters.com/ for their fantastic book that set me on this path.
+3 -3
View File
@@ -661,7 +661,7 @@ static int nativeConcat(Toy_Interpreter* interpreter, Toy_LiteralArray* argument
}
//get the combined length for the new string
size_t length = TOY_AS_STRING(selfLiteral)->length + TOY_AS_STRING(otherLiteral)->length + 1;
size_t length = TOY_AS_STRING(selfLiteral)->length + TOY_AS_STRING(otherLiteral)->length;
if (length > TOY_MAX_STRING_LENGTH) {
interpreter->errorOutput("Can't concatenate these strings, result is too long (error found in concat)\n");
@@ -671,8 +671,8 @@ static int nativeConcat(Toy_Interpreter* interpreter, Toy_LiteralArray* argument
}
//allocate the space and generate
char* buffer = TOY_ALLOCATE(char, length);
snprintf(buffer, length, "%s%s", Toy_toCString(TOY_AS_STRING(selfLiteral)), Toy_toCString(TOY_AS_STRING(otherLiteral)));
char* buffer = TOY_ALLOCATE(char, length + 1);
snprintf(buffer, length + 1, "%s%s", Toy_toCString(TOY_AS_STRING(selfLiteral)), Toy_toCString(TOY_AS_STRING(otherLiteral)));
Toy_Literal result = TOY_TO_STRING_LITERAL(Toy_createRefString(buffer));
+4 -4
View File
@@ -362,8 +362,8 @@ void Toy_emitASTNodeAnd(Toy_ASTNode** nodeHandle, Toy_ASTNode* rhs) {
Toy_ASTNode* tmp = TOY_ALLOCATE(Toy_ASTNode, 1);
tmp->type = TOY_AST_NODE_AND;
tmp->binary.left = *nodeHandle;
tmp->binary.right = rhs;
tmp->pathAnd.left = *nodeHandle;
tmp->pathAnd.right = rhs;
*nodeHandle = tmp;
}
@@ -372,8 +372,8 @@ void Toy_emitASTNodeOr(Toy_ASTNode** nodeHandle, Toy_ASTNode* rhs) {
Toy_ASTNode* tmp = TOY_ALLOCATE(Toy_ASTNode, 1);
tmp->type = TOY_AST_NODE_OR;
tmp->binary.left = *nodeHandle;
tmp->binary.right = rhs;
tmp->pathOr.left = *nodeHandle;
tmp->pathOr.right = rhs;
*nodeHandle = tmp;
}
+1 -1
View File
@@ -64,7 +64,7 @@ The current patch version of Toy. This value is embedded into the bytecode.
This value MUST fit into an unsigned char.
!*/
#define TOY_VERSION_PATCH 1
#define TOY_VERSION_PATCH 2
/*!
### TOY_VERSION_BUILD
+2 -2
View File
@@ -455,8 +455,8 @@ static void printToBuffer(const char* str) {
globalPrintBuffer = TOY_GROW_ARRAY(char, globalPrintBuffer, oldCapacity, globalPrintCapacity);
}
snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "\0");
globalPrintCount += strlen(str);
size_t total = snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "\0");
globalPrintCount += total;
}
//exposed functions
+1 -1
View File
@@ -22,7 +22,7 @@ void* Toy_private_defaultMemoryAllocator(void* pointer, size_t oldSize, size_t n
void* mem = realloc(pointer, newSize);
if (mem == NULL) {
fprintf(stderr, TOY_CC_ERROR "[internal] Memory allocation error (requested %zu, replacing %zu)\n" TOY_CC_RESET, newSize, oldSize);
fprintf(stderr, TOY_CC_ERROR "[internal] Memory allocation error (requested %d, replacing %d)\n" TOY_CC_RESET, (int)newSize, (int)oldSize);
return NULL;
}