comparison src/dict.c @ 21761:5a2373c25a86 v8.2.1430

patch 8.2.1430: Vim9: error for missing comma instead of extra white space Commit: https://github.com/vim/vim/commit/db199216e81865350a8d56a603bb86cab672bfad Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 12 18:01:53 2020 +0200 patch 8.2.1430: Vim9: error for missing comma instead of extra white space Problem: Vim9: error for missing comma instead of extra white space. Solution: Check if comma can be found after white space. (closes https://github.com/vim/vim/issues/6668) Also check for extra white space in literal dict. (closes #6670)
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Aug 2020 18:15:04 +0200
parents f41c646cb8b9
children 703ea7603d3e
comparison
equal deleted inserted replaced
21760:5abc63ecc7a4 21761:5a2373c25a86
779 for (p = *arg; ASCII_ISALNUM(*p) || *p == '_' || *p == '-'; ++p) 779 for (p = *arg; ASCII_ISALNUM(*p) || *p == '_' || *p == '-'; ++p)
780 ; 780 ;
781 tv->v_type = VAR_STRING; 781 tv->v_type = VAR_STRING;
782 tv->vval.v_string = vim_strnsave(*arg, p - *arg); 782 tv->vval.v_string = vim_strnsave(*arg, p - *arg);
783 783
784 *arg = skipwhite(p); 784 *arg = p;
785 return OK; 785 return OK;
786 } 786 }
787 787
788 /* 788 /*
789 * Allocate a variable for a Dictionary and fill it from "*arg". 789 * Allocate a variable for a Dictionary and fill it from "*arg".
843 if (!vim9script) 843 if (!vim9script)
844 *arg = skipwhite(*arg); 844 *arg = skipwhite(*arg);
845 if (**arg != ':') 845 if (**arg != ':')
846 { 846 {
847 if (evaluate) 847 if (evaluate)
848 semsg(_(e_missing_dict_colon), *arg); 848 {
849 if (*skipwhite(*arg) == ':')
850 semsg(_(e_no_white_before), ":");
851 else
852 semsg(_(e_missing_dict_colon), *arg);
853 }
849 clear_tv(&tvkey); 854 clear_tv(&tvkey);
850 goto failret; 855 goto failret;
851 } 856 }
852 if (evaluate) 857 if (evaluate)
853 { 858 {