diff --git a/include/pocketpy/codeobject.h b/include/pocketpy/codeobject.h index a136f635..9ad1df12 100644 --- a/include/pocketpy/codeobject.h +++ b/include/pocketpy/codeobject.h @@ -128,35 +128,17 @@ struct FuncDecl { PyObject* value; // default value }; CodeObject_ code; // code object of this function - std::vector args; // indices in co->varnames - std::vector kwargs; // indices in co->varnames - int starred_arg; // index in co->varnames, -1 if no *arg - int starred_kwarg; // index in co->varnames, -1 if no **kwarg - bool nested; // whether this function is nested - - static const int MAX_K2I_CACHE = 16; - - int _keyword_to_index[MAX_K2I_CACHE]; // map from `kwargs[i].key` to `kwargs[i].index` + std::vector args; // indices in co->varnames + std::vector kwargs; // indices in co->varnames + int starred_arg = -1; // index in co->varnames, -1 if no *arg + int starred_kwarg = -1; // index in co->varnames, -1 if no **kwarg + bool nested = false; // whether this function is nested Str signature; // signature of this function Str docstring; // docstring of this function bool is_simple; - FuncDecl(){ - starred_arg = -1; - starred_kwarg = -1; - nested = false; - for(int i=0; iadd_kwarg_item(index, name, value); + decl->kwargs.push_back(FuncDecl::KwArg{index, name, value}); } break; case 3: decl->starred_kwarg = index;