comparison src/evalvars.c @ 34676:5b25ec43f208 v9.1.0219

patch 9.1.0219: Vim9: No enum support Commit: https://github.com/vim/vim/commit/3164cf8f12f14b725b918e3170bb0a9085af8298 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Mar 28 10:36:42 2024 +0100 patch 9.1.0219: Vim9: No enum support Problem: No enum support Solution: Implement enums for Vim9 script (Yegappan Lakshmanan) closes: #14224 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 28 Mar 2024 10:45:06 +0100
parents d7b7fa7edb3b
children d1b433ed9f07
comparison
equal deleted inserted replaced
34675:42bca55140ec 34676:5b25ec43f208
157 {VV_NAME("sizeoflong", VAR_NUMBER), NULL, VV_RO}, 157 {VV_NAME("sizeoflong", VAR_NUMBER), NULL, VV_RO},
158 {VV_NAME("sizeofpointer", VAR_NUMBER), NULL, VV_RO}, 158 {VV_NAME("sizeofpointer", VAR_NUMBER), NULL, VV_RO},
159 {VV_NAME("maxcol", VAR_NUMBER), NULL, VV_RO}, 159 {VV_NAME("maxcol", VAR_NUMBER), NULL, VV_RO},
160 {VV_NAME("python3_version", VAR_NUMBER), NULL, VV_RO}, 160 {VV_NAME("python3_version", VAR_NUMBER), NULL, VV_RO},
161 {VV_NAME("t_typealias", VAR_NUMBER), NULL, VV_RO}, 161 {VV_NAME("t_typealias", VAR_NUMBER), NULL, VV_RO},
162 {VV_NAME("t_enum", VAR_NUMBER), NULL, VV_RO},
163 {VV_NAME("t_enumvalue", VAR_NUMBER), NULL, VV_RO},
162 }; 164 };
163 165
164 // shorthand 166 // shorthand
165 #define vv_tv_type vv_di.di_tv.v_type 167 #define vv_tv_type vv_di.di_tv.v_type
166 #define vv_nr vv_di.di_tv.vval.v_number 168 #define vv_nr vv_di.di_tv.vval.v_number
260 set_vim_var_nr(VV_TYPE_CHANNEL, VAR_TYPE_CHANNEL); 262 set_vim_var_nr(VV_TYPE_CHANNEL, VAR_TYPE_CHANNEL);
261 set_vim_var_nr(VV_TYPE_BLOB, VAR_TYPE_BLOB); 263 set_vim_var_nr(VV_TYPE_BLOB, VAR_TYPE_BLOB);
262 set_vim_var_nr(VV_TYPE_CLASS, VAR_TYPE_CLASS); 264 set_vim_var_nr(VV_TYPE_CLASS, VAR_TYPE_CLASS);
263 set_vim_var_nr(VV_TYPE_OBJECT, VAR_TYPE_OBJECT); 265 set_vim_var_nr(VV_TYPE_OBJECT, VAR_TYPE_OBJECT);
264 set_vim_var_nr(VV_TYPE_TYPEALIAS, VAR_TYPE_TYPEALIAS); 266 set_vim_var_nr(VV_TYPE_TYPEALIAS, VAR_TYPE_TYPEALIAS);
267 set_vim_var_nr(VV_TYPE_ENUM, VAR_TYPE_ENUM);
268 set_vim_var_nr(VV_TYPE_ENUMVALUE, VAR_TYPE_ENUMVALUE);
265 269
266 set_vim_var_nr(VV_ECHOSPACE, sc_col - 1); 270 set_vim_var_nr(VV_ECHOSPACE, sc_col - 1);
267 271
268 set_vim_var_dict(VV_COLORNAMES, dict_alloc()); 272 set_vim_var_dict(VV_COLORNAMES, dict_alloc());
269 273