mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Working on memory issues
This commit is contained in:
@@ -26,6 +26,7 @@ DONE: assert needs to kill the whole script, not just functions
|
|||||||
DONE: native functions
|
DONE: native functions
|
||||||
DONE: global functions _get, _set, _push, _pop, _length, clear available
|
DONE: global functions _get, _set, _push, _pop, _length, clear available
|
||||||
|
|
||||||
|
|
||||||
TODO: slice and dot notation around the _index function
|
TODO: slice and dot notation around the _index function
|
||||||
TODO: ternary operator
|
TODO: ternary operator
|
||||||
TODO: Nullish types
|
TODO: Nullish types
|
||||||
@@ -37,5 +38,6 @@ TODO: standard library
|
|||||||
TODO: external runner library
|
TODO: external runner library
|
||||||
TODO: document how it all works
|
TODO: document how it all works
|
||||||
TODO: third output stream, for parser/compiler/interpreter errors
|
TODO: third output stream, for parser/compiler/interpreter errors
|
||||||
|
TODO: better and more consistent error messages
|
||||||
|
|
||||||
NOPE: functions return a set number of values
|
NOPE: functions return a set number of values
|
||||||
@@ -42,6 +42,8 @@ bool injectNativeFn(Interpreter* interpreter, char* name, NativeFn func) {
|
|||||||
setLiteralDictionary(&interpreter->scope->variables, identifier, fn);
|
setLiteralDictionary(&interpreter->scope->variables, identifier, fn);
|
||||||
setLiteralDictionary(&interpreter->scope->types, identifier, type);
|
setLiteralDictionary(&interpreter->scope->types, identifier, type);
|
||||||
|
|
||||||
|
freeLiteral(identifier);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1377,7 +1377,7 @@ static void varDecl(Parser* parser, Node** nodeHandle) {
|
|||||||
|
|
||||||
static void fnDecl(Parser* parser, Node** nodeHandle) {
|
static void fnDecl(Parser* parser, Node** nodeHandle) {
|
||||||
//read the identifier
|
//read the identifier
|
||||||
consume(parser, TOKEN_IDENTIFIER, "Expected identifier after var keyword");
|
consume(parser, TOKEN_IDENTIFIER, "Expected identifier after fn keyword");
|
||||||
Token identifierToken = parser->previous;
|
Token identifierToken = parser->previous;
|
||||||
|
|
||||||
int length = identifierToken.length;
|
int length = identifierToken.length;
|
||||||
|
|||||||
Reference in New Issue
Block a user