Mercurial > vim
comparison src/testdir/test_vim9_assign.vim @ 24717:bf8feac8a89a v8.2.2897
patch 8.2.2897: Vim9: can use reserved words at the script level
Commit: https://github.com/vim/vim/commit/d0edaf9dc253e619ccc321ceaac321aee11c1ea5
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 28 21:06:08 2021 +0200
patch 8.2.2897: Vim9: can use reserved words at the script level
Problem: Vim9: can use reserved words at the script level.
Solution: Check variable names for reserved words. (closes https://github.com/vim/vim/issues/8253)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 28 May 2021 21:15:03 +0200 |
parents | 83877a1b66fd |
children | b6ac4ed5e2d2 |
comparison
equal
deleted
inserted
replaced
24716:33f991b5be54 | 24717:bf8feac8a89a |
---|---|
245 CheckDefFailure(['v:errmsg += 123'], 'E1012:') | 245 CheckDefFailure(['v:errmsg += 123'], 'E1012:') |
246 | 246 |
247 var text =<< trim END | 247 var text =<< trim END |
248 some text | 248 some text |
249 END | 249 END |
250 enddef | |
251 | |
252 def Test_reserved_name() | |
253 for name in ['true', 'false', 'null'] | |
254 CheckDefExecAndScriptFailure(['var ' .. name .. ' = 0'], 'E1034:') | |
255 CheckDefExecAndScriptFailure(['var ' .. name .. ': bool'], 'E1034:') | |
256 endfor | |
250 enddef | 257 enddef |
251 | 258 |
252 def Test_skipped_assignment() | 259 def Test_skipped_assignment() |
253 var lines =<< trim END | 260 var lines =<< trim END |
254 for x in [] | 261 for x in [] |