Working on memory issues

This commit is contained in:
2022-08-28 01:35:00 +01:00
parent 3355c3a4c2
commit 9c766ec61e
3 changed files with 5 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ DONE: assert needs to kill the whole script, not just functions
DONE: native functions
DONE: global functions _get, _set, _push, _pop, _length, clear available
TODO: slice and dot notation around the _index function
TODO: ternary operator
TODO: Nullish types
@@ -37,5 +38,6 @@ TODO: standard library
TODO: external runner library
TODO: document how it all works
TODO: third output stream, for parser/compiler/interpreter errors
TODO: better and more consistent error messages
NOPE: functions return a set number of values

View File

@@ -42,6 +42,8 @@ bool injectNativeFn(Interpreter* interpreter, char* name, NativeFn func) {
setLiteralDictionary(&interpreter->scope->variables, identifier, fn);
setLiteralDictionary(&interpreter->scope->types, identifier, type);
freeLiteral(identifier);
return true;
}

View File

@@ -1377,7 +1377,7 @@ static void varDecl(Parser* parser, Node** nodeHandle) {
static void fnDecl(Parser* parser, Node** nodeHandle) {
//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;
int length = identifierToken.length;