comparison src/vim9compile.c @ 23806:c0f2c6c56147 v8.2.2444

patch 8.2.2444: Vim9: compile error with combination of operator and list Commit: https://github.com/vim/vim/commit/e507ff15d52653dad3054ddc0073708977621c0c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 31 21:47:42 2021 +0100 patch 8.2.2444: Vim9: compile error with combination of operator and list Problem: Vim9: compile error with combination of operator and list. Solution: Generate constants before parsing a list or dict. (closes https://github.com/vim/vim/issues/7757)
author Bram Moolenaar <Bram@vim.org>
date Sun, 31 Jan 2021 22:00:03 +0100
parents 7caffd835aa1
children 525c9e218c69
comparison
equal deleted inserted replaced
23805:c17b61789da3 23806:c0f2c6c56147
4119 break; 4119 break;
4120 4120
4121 /* 4121 /*
4122 * List: [expr, expr] 4122 * List: [expr, expr]
4123 */ 4123 */
4124 case '[': ret = compile_list(arg, cctx, ppconst); 4124 case '[': if (generate_ppconst(cctx, ppconst) == FAIL)
4125 return FAIL;
4126 ret = compile_list(arg, cctx, ppconst);
4125 break; 4127 break;
4126 4128
4127 /* 4129 /*
4128 * Dictionary: {'key': val, 'key': val} 4130 * Dictionary: {'key': val, 'key': val}
4129 */ 4131 */
4130 case '{': ret = compile_dict(arg, cctx, ppconst); 4132 case '{': if (generate_ppconst(cctx, ppconst) == FAIL)
4133 return FAIL;
4134 ret = compile_dict(arg, cctx, ppconst);
4131 break; 4135 break;
4132 4136
4133 /* 4137 /*
4134 * Option value: &name 4138 * Option value: &name
4135 */ 4139 */