}
/*
+ * Skip over white space at "whitep" and assign to "*arg".
* If "*arg" is at the end of the line, advance to the next line.
* Also when "whitep" points to white space and "*arg" is on a "#".
* Return FAIL if beyond the last line, "*arg" is unmodified then.
static int
may_get_next_line(char_u *whitep, char_u **arg, cctx_T *cctx)
{
+ *arg = skipwhite(whitep);
if (**arg == NUL || (VIM_ISWHITE(*whitep) && vim9_comment_start(*arg)))
{
char_u *next = next_line_from_context(cctx, TRUE);
int count = 0;
dict_T *d = dict_alloc();
dictitem_T *item;
- char_u *whitep = *arg;
+ char_u *whitep = *arg + 1;
char_u *p;
int is_const;
int is_all_const = TRUE; // reset when non-const encountered
if (d == NULL)
return FAIL;
- *arg = skipwhite(*arg + 1);
for (;;)
{
char_u *key = NULL;
return FAIL;
}
- *arg = skipwhite(*arg + 1);
if (may_get_next_line(whitep, arg, cctx) == FAIL)
{
*arg = NULL;
++count;
whitep = *arg;
- *arg = skipwhite(*arg);
if (may_get_next_line(whitep, arg, cctx) == FAIL)
{
*arg = NULL;
static int
compile_parenthesis(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
{
- int ret;
+ int ret;
*arg = skipwhite(*arg + 1);
if (ppconst->pp_used <= PPSIZE - 10)
return FAIL;
ret = compile_expr0(arg, cctx);
}
- *arg = skipwhite(*arg);
+ if (may_get_next_line_error(*arg, arg, cctx) == FAIL)
+ return FAIL;
if (**arg == ')')
++*arg;
else if (ret == OK)
ppconst->pp_is_const = FALSE;
++p;
- *arg = skipwhite(p);
if (may_get_next_line_error(p, arg, cctx) == FAIL)
return FAIL;
if (**arg == ':')
":", *arg);
return FAIL;
}
- if (may_get_next_line_error(p, arg, cctx) == FAIL)
+ if (may_get_next_line_error(*arg, arg, cctx) == FAIL)
return FAIL;
*arg = skipwhite(*arg);
}
":", *arg);
return FAIL;
}
- *arg = skipwhite(*arg);
- if (may_get_next_line_error(p, arg, cctx) == FAIL)
+ if (may_get_next_line_error(*arg, arg, cctx) == FAIL)
return FAIL;
if (**arg == ']')
// missing second index is equal to end of string
{
if (compile_expr0(arg, cctx) == FAIL)
return FAIL;
- if (may_get_next_line_error(p, arg, cctx) == FAIL)
+ if (may_get_next_line_error(*arg, arg, cctx) == FAIL)
return FAIL;
*arg = skipwhite(*arg);
}
return FAIL;
}
++*arg;
- if (may_get_next_line_error(*arg - 1, arg, cctx) == FAIL)
+ if (may_get_next_line_error(*arg, arg, cctx) == FAIL)
return FAIL;
}
error_white_both(op, 1);
return FAIL;
}
- *arg = skipwhite(op + 1);
if (may_get_next_line_error(op + 1, arg, cctx) == FAIL)
return FAIL;
return FAIL;
}
- *arg = skipwhite(op + oplen);
if (may_get_next_line_error(op + oplen, arg, cctx) == FAIL)
return FAIL;
}
// get the second variable
- *arg = skipwhite(p + len);
if (may_get_next_line_error(p + len, arg, cctx) == FAIL)
return FAIL;
? JUMP_IF_COND_TRUE : JUMP_IF_COND_FALSE, 0);
// eval the next expression
- *arg = skipwhite(p + 2);
if (may_get_next_line_error(p + 2, arg, cctx) == FAIL)
{
ga_clear(&end_ga);
}
// evaluate the second expression; any type is accepted
- *arg = skipwhite(p + 1 + op_falsy);
if (may_get_next_line_error(p + 1 + op_falsy, arg, cctx) == FAIL)
return FAIL;
if (compile_expr1(arg, cctx, ppconst) == FAIL)
if (has_const_expr)
cctx->ctx_skip = save_skip == SKIP_YES || const_value
? SKIP_YES : SKIP_NOT;
- *arg = skipwhite(p + 1);
if (may_get_next_line_error(p + 1, arg, cctx) == FAIL)
return FAIL;
if (compile_expr1(arg, cctx, ppconst) == FAIL)
// A line break may follow the "=".
wp = op + oplen;
- p = skipwhite(wp);
if (may_get_next_line_error(wp, &p, cctx) == FAIL)
return FAIL;
if (compile_expr0(&p, cctx) == FAIL)
--cctx->ctx_locals.ga_len;
instr_count = instr->ga_len;
wp = op + oplen;
- p = skipwhite(wp);
if (may_get_next_line_error(wp, &p, cctx) == FAIL)
{
if (new_local)
// consume "in"
wp = p;
- p = skipwhite(p);
if (may_get_next_line_error(wp, &p, cctx) == FAIL)
return NULL;
if (STRNCMP(p, "in", 2) != 0 || !IS_WHITE_OR_NUL(p[2]))
return NULL;
}
wp = p + 2;
- p = skipwhite(wp);
if (may_get_next_line_error(wp, &p, cctx) == FAIL)
return NULL;