comparison src/ex_docmd.c @ 21544:6c67c86a202a v8.2.1322

patch 8.2.1322: Vim9: method on double quoted string doesn't work Commit: https://github.com/vim/vim/commit/1040956292a9f2c3d02fc08febd5acf349c85590 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 29 20:00:38 2020 +0200 patch 8.2.1322: Vim9: method on double quoted string doesn't work Problem: Vim9: method on double quoted string doesn't work. Solution: Recognize double quoted string. (closes https://github.com/vim/vim/issues/6562)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Jul 2020 20:15:03 +0200
parents a7afee13873d
children d0c76ce48326
comparison
equal deleted inserted replaced
21543:456123afa2ec 21544:6c67c86a202a
3275 { 3275 {
3276 // Skip over first char for "&opt = val", "$ENV = val" and "@r = val". 3276 // Skip over first char for "&opt = val", "$ENV = val" and "@r = val".
3277 char_u *pskip = (*eap->cmd == '&' || *eap->cmd == '$' 3277 char_u *pskip = (*eap->cmd == '&' || *eap->cmd == '$'
3278 || *eap->cmd == '@') ? eap->cmd + 1 : eap->cmd; 3278 || *eap->cmd == '@') ? eap->cmd + 1 : eap->cmd;
3279 3279
3280 if (vim_strchr((char_u *)"{('[", *p) != NULL 3280 if (vim_strchr((char_u *)"{('[\"", *p) != NULL
3281 || ((p = to_name_const_end(pskip)) > eap->cmd && *p != NUL)) 3281 || ((p = to_name_const_end(pskip)) > eap->cmd && *p != NUL))
3282 { 3282 {
3283 int oplen; 3283 int oplen;
3284 int heredoc; 3284 int heredoc;
3285 3285
3291 ? ( 3291 ? (
3292 // "{..." is an dict expression. 3292 // "{..." is an dict expression.
3293 *eap->cmd == '{' 3293 *eap->cmd == '{'
3294 // "'string'->func()" is an expression. 3294 // "'string'->func()" is an expression.
3295 || *eap->cmd == '\'' 3295 || *eap->cmd == '\''
3296 // '"string"->func()' is an expression.
3297 || *eap->cmd == '"'
3296 // "g:varname" is an expression. 3298 // "g:varname" is an expression.
3297 || eap->cmd[1] == ':' 3299 || eap->cmd[1] == ':'
3298 ) 3300 )
3299 : ( 3301 : (
3300 // "varname[]" is an expression. 3302 // "varname[]" is an expression.