Mercurial > vim
diff src/vim.h @ 20397:c225be44692a v8.2.0753
patch 8.2.0753: Vim9: expressions are evaluated in the discovery phase
Commit: https://github.com/vim/vim/commit/32e351179eacfc84f64cd5029e221582d400bb38
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 14 22:41:15 2020 +0200
patch 8.2.0753: Vim9: expressions are evaluated in the discovery phase
Problem: Vim9: expressions are evaluated in the discovery phase.
Solution: Bail out if an expression is not a constant. Require a type for
declared constants.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 14 May 2020 22:45:04 +0200 |
parents | 220312b278a9 |
children | 489cb75c76b6 |
line wrap: on
line diff
--- a/src/vim.h +++ b/src/vim.h @@ -2133,7 +2133,7 @@ typedef enum { // Flags for assignment functions. #define LET_IS_CONST 1 // ":const" #define LET_NO_COMMAND 2 // "var = expr" without ":let" or ":const" -#define LET_REDEFINE 4 // variable can be redefined later +#define LET_DISCOVERY 4 // discovery phase: variable can be redefined later #include "ex_cmds.h" // Ex command defines #include "spell.h" // spell checking stuff @@ -2662,4 +2662,8 @@ long elapsed(DWORD start_tick); #define REPTERM_SPECIAL 4 #define REPTERM_NO_SIMPLIFY 8 +// Flags for expression evaluation. +#define EVAL_EVALUATE 1 // when missing don't actually evaluate +#define EVAL_CONSTANT 2 // when not a constant return FAIL + #endif // VIM__H