0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.2035: recognizing octal numbers is confusing

Problem:    Recognizing octal numbers is confusing.
Solution:   Introduce scriptversion 4: do not use octal and allow for single
            quote inside numbers.
This commit is contained in:
Bram Moolenaar
2019-09-15 14:33:22 +02:00
parent 50bf7ce0c9
commit 60a8de28d1
8 changed files with 78 additions and 27 deletions

View File

@@ -2617,7 +2617,9 @@ eval7(
else
{
// decimal, hex or octal number
vim_str2nr(*arg, NULL, &len, STR2NR_ALL, &n, NULL, 0, TRUE);
vim_str2nr(*arg, NULL, &len, current_sctx.sc_version >= 4
? STR2NR_NO_OCT + STR2NR_QUOTE
: STR2NR_ALL, &n, NULL, 0, TRUE);
if (len == 0)
{
semsg(_(e_invexpr2), *arg);