Mercurial > vim
comparison src/vim9compile.c @ 27696:78d4f843521a v8.2.4374
patch 8.2.4374: unreachable code
Commit: https://github.com/vim/vim/commit/0631bb4ed7674b88ba395daf59ed222f77bc4913
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 13 21:20:21 2022 +0000
patch 8.2.4374: unreachable code
Problem: Unreachable code.
Solution: Remove outdated code lines.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 13 Feb 2022 22:30:03 +0100 |
parents | 5c4ab8d4472c |
children | 3813036f19cb |
comparison
equal
deleted
inserted
replaced
27695:52fcfbb9dab0 | 27696:78d4f843521a |
---|---|
289 * imported or function. | 289 * imported or function. |
290 */ | 290 */ |
291 static int | 291 static int |
292 item_exists(char_u *name, size_t len, int cmd UNUSED, cctx_T *cctx) | 292 item_exists(char_u *name, size_t len, int cmd UNUSED, cctx_T *cctx) |
293 { | 293 { |
294 int is_global; | 294 return variable_exists(name, len, cctx); |
295 char_u *p; | |
296 | |
297 if (variable_exists(name, len, cctx)) | |
298 return TRUE; | |
299 | |
300 // This is similar to what is in lookup_scriptitem(): | |
301 // Find a function, so that a following "->" works. | |
302 // Require "(" or "->" to follow, "Cmd" is a user command while "Cmd()" is | |
303 // a function call. | |
304 p = skipwhite(name + len); | |
305 | |
306 if (name[len] == '(' || (p[0] == '-' && p[1] == '>')) | |
307 { | |
308 // Do not check for an internal function, since it might also be a | |
309 // valid command, such as ":split" versus "split()". | |
310 // Skip "g:" before a function name. | |
311 is_global = (name[0] == 'g' && name[1] == ':'); | |
312 return find_func(is_global ? name + 2 : name, is_global) != NULL; | |
313 } | |
314 return FALSE; | |
315 } | 295 } |
316 | 296 |
317 /* | 297 /* |
318 * Check if "p[len]" is already defined, either in script "import_sid" or in | 298 * Check if "p[len]" is already defined, either in script "import_sid" or in |
319 * compilation context "cctx". "cctx" is NULL at the script level. | 299 * compilation context "cctx". "cctx" is NULL at the script level. |