mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-17 15:54:07 +10:00
Function calls, with args and single returns are working
This commit is contained in:
@@ -90,7 +90,12 @@ static bool checkType(Literal typeLiteral, Literal value) {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: function type checking
|
||||
if (IS_FUNCTION(value)) {
|
||||
//check value's type
|
||||
if (AS_TYPE(typeLiteral).typeOf != LITERAL_FUNCTION) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (AS_TYPE(typeLiteral).typeOf == LITERAL_TYPE && !IS_TYPE(value)) {
|
||||
return false;
|
||||
@@ -108,7 +113,7 @@ Scope* pushScope(Scope* ancestor) {
|
||||
|
||||
//tick up all scope reference counts
|
||||
scope->references = 0;
|
||||
for (Scope* ptr = scope; ptr; ptr = ptr->ancestor) {
|
||||
for (Scope* ptr = scope; ptr != NULL; ptr = ptr->ancestor) {
|
||||
ptr->references++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user