#ifndef INTERPRETER_PARAMETERS_CURRENT_H #define INTERPRETER_PARAMETERS_CURRENT_H #include "assert.h" #include "errors/errors.h" #include "errors/exceptions.h" #include "memory/virtualmemory.h" #include "object.h" #include "types/composites/dictionary.h" #include "types/names.h" static inline object *current(object key, object dictionary) { switch (key.type) { case stringtype: { if (key.access > readonly) throw (invalidaccess); key = cvn(key); } case nametype: { break; } default: { throw (typecheck); } } assert(dictionary.type == dicttype); dictionary.dict = readvm(dictionary.dict); assert(dictaccess(dictionary) == readonly); return find(key, dictionary); } #endif