comparison src/structs.h @ 23559:64dfb69e7d46 v8.2.2322

patch 8.2.2322: Vim9: closure nested limiting to one level Commit: https://github.com/vim/vim/commit/0186e58639b19933d3d9188d552fe6745265eb1b Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 18:33:11 2021 +0100 patch 8.2.2322: Vim9: closure nested limiting to one level Problem: Vim9: closure nested limiting to one level. Solution: Add outer_T. Also make STOREOUTER work.
author Bram Moolenaar <Bram@vim.org>
date Sun, 10 Jan 2021 18:45:04 +0100
parents f50ee1ae4d9b
children 85ce241ff9e3
comparison
equal deleted inserted replaced
23558:b9004f7d5aec 23559:64dfb69e7d46
1963 int fs_refcount; // nr of closures referencing this funcstack 1963 int fs_refcount; // nr of closures referencing this funcstack
1964 int fs_min_refcount; // nr of closures on this funcstack 1964 int fs_min_refcount; // nr of closures on this funcstack
1965 int fs_copyID; // for garray_T collection 1965 int fs_copyID; // for garray_T collection
1966 } funcstack_T; 1966 } funcstack_T;
1967 1967
1968 typedef struct outer_S outer_T;
1969 struct outer_S {
1970 garray_T *out_stack; // stack from outer scope
1971 int out_frame_idx; // index of stack frame in out_stack
1972 outer_T *out_up; // outer scope of outer scope or NULL
1973 int out_up_is_copy; // don't free out_up
1974 };
1975
1968 struct partial_S 1976 struct partial_S
1969 { 1977 {
1970 int pt_refcount; // reference count 1978 int pt_refcount; // reference count
1971 char_u *pt_name; // function name; when NULL use 1979 char_u *pt_name; // function name; when NULL use
1972 // pt_func->uf_name 1980 // pt_func->uf_name
1973 ufunc_T *pt_func; // function pointer; when NULL lookup function 1981 ufunc_T *pt_func; // function pointer; when NULL lookup function
1974 // with pt_name 1982 // with pt_name
1975 int pt_auto; // when TRUE the partial was created for using 1983 int pt_auto; // when TRUE the partial was created for using
1976 // dict.member in handle_subscript() 1984 // dict.member in handle_subscript()
1977 1985
1978 // For a compiled closure: the arguments and local variables. 1986 // For a compiled closure: the arguments and local variables scope
1979 garray_T *pt_ectx_stack; // where to find local vars 1987 outer_T pt_outer;
1980 int pt_ectx_frame; // index of function frame in uf_ectx_stack 1988
1981 garray_T *pt_outer_stack; // pt_ectx_stack one level up 1989 funcstack_T *pt_funcstack; // copy of stack, used after context
1982 int pt_outer_frame; // pt_ectx_frame one level up. 1990 // function returns
1983 funcstack_T *pt_funcstack; // copy of stack, used after context
1984 // function returns
1985 1991
1986 int pt_argc; // number of arguments 1992 int pt_argc; // number of arguments
1987 typval_T *pt_argv; // arguments in allocated array 1993 typval_T *pt_argv; // arguments in allocated array
1988 1994
1989 dict_T *pt_dict; // dict for "self" 1995 dict_T *pt_dict; // dict for "self"