Andy Wokula wrote:
> Am 15.09.2019 um 14:33 schrieb Bram Moolenaar:
> > Patch 8.1.2035
> > Problem: Recognizing octal numbers is confusing.
> > Solution: Introduce scriptversion 4: do not use octal and allow for single
> > quote inside numbers.
> > Files: runtime/doc/eval.txt, src/vim.h, src/eval.c,
> > src/scriptfile.c,
> > src/evalfunc.c, src/testdir/test_eval_stuff.vim,
> > src/testdir/test_functions.vim
>
> Single quotes could be a pitfall for scripts that attempt to skip string
> literals in Vim script code.
It's not difficult to handle this syntax.
> > // flags for vim_str2nr()
> > ! #define STR2NR_BIN 0x01
> > ! #define STR2NR_OCT 0x02
> > ! #define STR2NR_HEX 0x04
> > #define STR2NR_ALL (STR2NR_BIN + STR2NR_OCT + STR2NR_HEX)
> > ! #define STR2NR_NO_OCT (STR2NR_BIN + STR2NR_HEX)
> > !
> > ! #define STR2NR_FORCE 0x80 // only when ONE of the above is used
>
> Is 0x80 the intended value or 0x08 ?
Doesn't matter, just wanted to make sure it's further away from the
BIN/OCT/HEX values.
> > ! #define STR2NR_QUOTE 0x10 // ignore embedded single quotes
>
> What happens with
> :echo 1''234
> :echo 1'''234
> ? Is it an error?
A double single quote is not part of the number, thus 1''234 is the same
as
:echo 1 '' 234
Should add a test for that.
--
Women are probably the main cause of free software starvation.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/201909151913.x8FJD0Hj023528%40masaka.moolenaar.net.