Mercurial > vim
comparison src/evalfunc.c @ 25525:8880eb140a00 v8.2.3299
patch 8.2.3299: Vim9: exists() does not handle much at compile time
Commit: https://github.com/vim/vim/commit/5671f3f076573fa9133bc210d6580067698d9a1b
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 5 22:48:11 2021 +0200
patch 8.2.3299: Vim9: exists() does not handle much at compile time
Problem: Vim9: exists() does not handle much at compile time.
Solution: Handle variable names. (closes https://github.com/vim/vim/issues/8688)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 05 Aug 2021 23:00:04 +0200 |
parents | fbdfa533001c |
children | d5e9c05b4811 |
comparison
equal
deleted
inserted
replaced
25524:359c6acd9ad1 | 25525:8880eb140a00 |
---|---|
3550 if (*skipwhite(p) != NUL) | 3550 if (*skipwhite(p) != NUL) |
3551 n = FALSE; // trailing garbage | 3551 n = FALSE; // trailing garbage |
3552 } | 3552 } |
3553 else if (*p == '*') // internal or user defined function | 3553 else if (*p == '*') // internal or user defined function |
3554 { | 3554 { |
3555 int save_version = current_sctx.sc_version; | |
3556 | |
3557 // Vim9 script assumes a function is script-local, but here we want to | |
3558 // find any matching function. | |
3559 if (current_sctx.sc_version == SCRIPT_VERSION_VIM9) | |
3560 current_sctx.sc_version = SCRIPT_VERSION_MAX; | |
3555 n = function_exists(p + 1, FALSE); | 3561 n = function_exists(p + 1, FALSE); |
3562 current_sctx.sc_version = save_version; | |
3556 } | 3563 } |
3557 else if (*p == '?') // internal function only | 3564 else if (*p == '?') // internal function only |
3558 { | 3565 { |
3559 n = has_internal_func_name(p + 1); | 3566 n = has_internal_func_name(p + 1); |
3560 } | 3567 } |