diff options
| author | ZyX <kp-pav@yandex.ru> | 2017-11-26 16:08:53 +0300 | 
|---|---|---|
| committer | ZyX <kp-pav@yandex.ru> | 2017-11-26 16:08:53 +0300 | 
| commit | 17077b68133a62d0dc1b84cb48779464c117e028 (patch) | |
| tree | d6c16020cd387e1c612256bb03e2b55c4448ed00 /src | |
| parent | 11a05e778fd5f33f791ca8047f9839caa15b8da5 (diff) | |
| download | rneovim-17077b68133a62d0dc1b84cb48779464c117e028.tar.gz rneovim-17077b68133a62d0dc1b84cb48779464c117e028.tar.bz2 rneovim-17077b68133a62d0dc1b84cb48779464c117e028.zip | |
viml/parser/expressions: Make $ENV not depend on &isident
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/api/vim.c | 2 | ||||
| -rw-r--r-- | src/nvim/viml/parser/expressions.c | 19 | 
2 files changed, 12 insertions, 9 deletions
| diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 7838f9faa3..a0816dbc8e 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -983,7 +983,7 @@ typedef kvec_withinit_t(ExprASTConvStackItem, 16) ExprASTConvStack;  ///                     "DoubleQuotedString" nodes.  Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight,                                   Error *err) -  FUNC_API_SINCE(4) +  FUNC_API_SINCE(4) FUNC_API_ASYNC  {    int pflags = 0;    for (size_t i = 0 ; i < flags.size ; i++) { diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c index 6c7c328b6d..63ad6bab35 100644 --- a/src/nvim/viml/parser/expressions.c +++ b/src/nvim/viml/parser/expressions.c @@ -47,6 +47,8 @@  //    type of what is in the first expression is generally not known when  //    parsing, so to have separate expressions like this separate them with  //    spaces. +// 7. 'isident' no longer applies to environment variables, they always include +//    ASCII alphanumeric characters and underscore and nothing except this.  #include <stdbool.h>  #include <stddef.h> @@ -383,10 +385,14 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags)        break;      } +#define ISWORD_OR_AUTOLOAD(x) \ +      (ASCII_ISALNUM(x) || (x) == AUTOLOAD_CHAR || (x) == '_') +#define ISWORD(x) \ +      (ASCII_ISALNUM(x) || (x) == '_') +      // Environment variable.      case '$': { -      // FIXME: Parser function can’t be thread-safe with vim_isIDc. -      CHARREG(kExprLexEnv, vim_isIDc); +      CHARREG(kExprLexEnv, ISWORD);        break;      } @@ -400,10 +406,6 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags)      case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U':      case 'V': case 'W': case 'X': case 'Y': case 'Z':      case '_': { -#define ISWORD_OR_AUTOLOAD(x) \ -      (ASCII_ISALNUM(x) || (x) == AUTOLOAD_CHAR || (x) == '_') -#define ISWORD(x) \ -      (ASCII_ISALNUM(x) || (x) == '_')        ret.data.var.scope = 0;        ret.data.var.autoload = false;        CHARREG(kExprLexPlainIdentifier, ISWORD); @@ -441,9 +443,10 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags)          CHARREG(kExprLexPlainIdentifier, ISWORD_OR_AUTOLOAD);        }        break; -#undef ISWORD_OR_AUTOLOAD -#undef ISWORD      } + +#undef ISWORD +#undef ISWORD_OR_AUTOLOAD  #undef CHARREG      // Option. | 
