comparison src/vim9expr.c @ 26769:30972227ac8d v8.2.3913

patch 8.2.3913: help for expressions does not mention Vim9 syntax Commit: https://github.com/vim/vim/commit/5da36052a4bb0f3a9747ec3a8ab9d85e058e39fa Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 27 15:39:57 2021 +0000 patch 8.2.3913: help for expressions does not mention Vim9 syntax Problem: Help for expressions does not mention Vim9 syntax. Solution: Add the rules for Vim9 to the expression help. Rename functions to match the help.
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Dec 2021 16:45:03 +0100
parents 1b288eb2fcdc
children 06a137af96f8
comparison
equal deleted inserted replaced
26768:cdea9da4aeb3 26769:30972227ac8d
1881 * trailing [] subscript in String or List 1881 * trailing [] subscript in String or List
1882 * trailing .name entry in Dictionary 1882 * trailing .name entry in Dictionary
1883 * trailing ->name() method call 1883 * trailing ->name() method call
1884 */ 1884 */
1885 static int 1885 static int
1886 compile_expr7( 1886 compile_expr8(
1887 char_u **arg, 1887 char_u **arg,
1888 cctx_T *cctx, 1888 cctx_T *cctx,
1889 ppconst_T *ppconst) 1889 ppconst_T *ppconst)
1890 { 1890 {
1891 char_u *start_leader, *end_leader; 1891 char_u *start_leader, *end_leader;
2117 return FAIL; 2117 return FAIL;
2118 return OK; 2118 return OK;
2119 } 2119 }
2120 2120
2121 /* 2121 /*
2122 * <type>expr7: runtime type check / conversion 2122 * <type>expr8: runtime type check / conversion
2123 */ 2123 */
2124 static int 2124 static int
2125 compile_expr7t(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) 2125 compile_expr7(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
2126 { 2126 {
2127 type_T *want_type = NULL; 2127 type_T *want_type = NULL;
2128 2128
2129 // Recognize <type> 2129 // Recognize <type>
2130 if (**arg == '<' && eval_isnamec1((*arg)[1])) 2130 if (**arg == '<' && eval_isnamec1((*arg)[1]))
2145 ++*arg; 2145 ++*arg;
2146 if (may_get_next_line_error(*arg, arg, cctx) == FAIL) 2146 if (may_get_next_line_error(*arg, arg, cctx) == FAIL)
2147 return FAIL; 2147 return FAIL;
2148 } 2148 }
2149 2149
2150 if (compile_expr7(arg, cctx, ppconst) == FAIL) 2150 if (compile_expr8(arg, cctx, ppconst) == FAIL)
2151 return FAIL; 2151 return FAIL;
2152 2152
2153 if (want_type != NULL) 2153 if (want_type != NULL)
2154 { 2154 {
2155 garray_T *stack = &cctx->ctx_type_stack; 2155 garray_T *stack = &cctx->ctx_type_stack;
2180 char_u *op; 2180 char_u *op;
2181 char_u *next; 2181 char_u *next;
2182 int ppconst_used = ppconst->pp_used; 2182 int ppconst_used = ppconst->pp_used;
2183 2183
2184 // get the first expression 2184 // get the first expression
2185 if (compile_expr7t(arg, cctx, ppconst) == FAIL) 2185 if (compile_expr7(arg, cctx, ppconst) == FAIL)
2186 return FAIL; 2186 return FAIL;
2187 2187
2188 /* 2188 /*
2189 * Repeat computing, until no "*", "/" or "%" is following. 2189 * Repeat computing, until no "*", "/" or "%" is following.
2190 */ 2190 */
2206 } 2206 }
2207 if (may_get_next_line_error(op + 1, arg, cctx) == FAIL) 2207 if (may_get_next_line_error(op + 1, arg, cctx) == FAIL)
2208 return FAIL; 2208 return FAIL;
2209 2209
2210 // get the second expression 2210 // get the second expression
2211 if (compile_expr7t(arg, cctx, ppconst) == FAIL) 2211 if (compile_expr7(arg, cctx, ppconst) == FAIL)
2212 return FAIL; 2212 return FAIL;
2213 2213
2214 if (ppconst->pp_used == ppconst_used + 2 2214 if (ppconst->pp_used == ppconst_used + 2
2215 && ppconst->pp_tv[ppconst_used].v_type == VAR_NUMBER 2215 && ppconst->pp_tv[ppconst_used].v_type == VAR_NUMBER
2216 && ppconst->pp_tv[ppconst_used + 1].v_type == VAR_NUMBER) 2216 && ppconst->pp_tv[ppconst_used + 1].v_type == VAR_NUMBER)