comparison src/vim9script.c @ 20846:709379ab5110 v8.2.0975

patch 8.2.0975: Vim9: script variable does not accept optional s: prefix Commit: https://github.com/vim/vim/commit/984dddbef421eda6b8ad60936f380c5f00aebb96 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 14 12:50:24 2020 +0200 patch 8.2.0975: Vim9: script variable does not accept optional s: prefix Problem: Vim9: script variable does not accept optional s: prefix. Solution: Adjust the accepted syntax.
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Jun 2020 13:00:04 +0200
parents 1360541e8c74
children 58137dbee8da
comparison
equal deleted inserted replaced
20845:67df55152c33 20846:709379ab5110
460 { 460 {
461 semsg(_(e_invarg2), arg); 461 semsg(_(e_invarg2), arg);
462 return arg + STRLEN(arg); 462 return arg + STRLEN(arg);
463 } 463 }
464 464
465 for (p = arg + 1; *p != NUL && *p != ':' && eval_isnamec(*p); 465 for (p = arg + 1; *p != NUL && eval_isnamec(*p); MB_PTR_ADV(p))
466 MB_PTR_ADV(p)) 466 if (*p == ':' && p != arg + 1)
467 ; 467 break;
468 468
469 if (*p != ':') 469 if (*p != ':')
470 { 470 {
471 emsg(_(e_type_req)); 471 emsg(_(e_type_req));
472 return arg + STRLEN(arg);
473 }
474 if (!VIM_ISWHITE(p[1]))
475 {
476 semsg(_(e_white_after), ":");
472 return arg + STRLEN(arg); 477 return arg + STRLEN(arg);
473 } 478 }
474 name = vim_strnsave(arg, p - arg); 479 name = vim_strnsave(arg, p - arg);
475 480
476 // parse type 481 // parse type