#include "system/error.h"
#include "system/line_stream.h"
#include "system/lt.h"
+#include "system/nth_alloc.h"
#include "ui/console.h"
struct Script
return NULL;
}
- Script *script = PUSH_LT(lt, malloc(sizeof(Script)), free);
+ Script *script = PUSH_LT(lt, nth_alloc(sizeof(Script)), free);
if (script == NULL) {
throw_error(ERROR_TYPE_LIBC);
RETURN_LT(lt, NULL);
return 0;
}
+
+bool script_has_scope_value(const Script *script, const char *name)
+{
+ return !nil_p(
+ get_scope_value(
+ &script->scope,
+ SYMBOL(script->gc, name)));
+}