[BUG] “:execute 'if 1'” works like “:if 1”

2014-03-20 Thread ZyX
Consider the following script: execute 'if 0' echo 'Not shown' else echo 'Shown' endif . If you source it you find that instead of 3 errors (“missing :endif”, “:else without :if”, “:endif without :if”) and two messages (“Not shown” and “Shown”) you will see one messa

Re: [BUG] “:execute 'if 1'” works like “:if 1”

2014-03-22 Thread Bram Moolenaar
ZyX wrote: > Consider the following script: > > execute 'if 0' > echo 'Not shown' > else > echo 'Shown' > endif > > . If you source it you find that instead of 3 errors (“missing > :endif”, “:else without :if”, “:endif without :if”) and two messages > (“Not shown” an

Re: [BUG] “:execute 'if 1'” works like “:if 1”

2014-03-22 Thread Marcin Szamotulski
On 15:33 Sat 22 Mar , Bram Moolenaar wrote: > > ZyX wrote: > > > Consider the following script: > > > > execute 'if 0' > > echo 'Not shown' > > else > > echo 'Shown' > > endif > > > > . If you source it you find that instead of 3 errors (“missing > > :endif”, “:e

Re: [BUG] “:execute 'if 1'” works like “:if 1”

2014-03-22 Thread Yukihiro Nakadaira
On Sat, Mar 22, 2014 at 11:33 PM, Bram Moolenaar wrote: > > ZyX wrote: > > > Consider the following script: > > > > execute 'if 0' > > echo 'Not shown' > > else > > echo 'Shown' > > endif > > > > . If you source it you find that instead of 3 errors (“missing > > :endif

Re: [BUG] “:execute 'if 1'” works like “:if 1”

2014-03-22 Thread ZyX
> The docs are wrong, using "if" is allowed. The other two are not. Why? It makes parsing impossible. E.g. like indicated by @Yukihiro Nakadaira, there is absolutely nothing you can do with this error unless you add hacks for some specific cases (e.g. if `execute` is followed by a string litera

Re: [BUG] “:execute 'if 1'” works like “:if 1”

2014-03-22 Thread Bram Moolenaar
ZyX wrote: > > The docs are wrong, using "if" is allowed. The other two are not. > > Why? It makes parsing impossible. E.g. like indicated by @Yukihiro > Nakadaira, there is absolutely nothing you can do with this error > unless you add hacks for some specific cases (e.g. if `execute` is > foll

Re: [BUG] “:execute 'if 1'” works like “:if 1”

2014-03-22 Thread Bram Moolenaar
Marcin Szamotulski wrote: > On 15:33 Sat 22 Mar , Bram Moolenaar wrote: > > > > ZyX wrote: > > > > > Consider the following script: > > > > > > execute 'if 0' > > > echo 'Not shown' > > > else > > > echo 'Shown' > > > endif > > > > > > . If you source it you fi

Re: [BUG] ":execute 'if 1'" works like ":if 1"

2014-03-22 Thread Nikolay Pavlov
On Mar 23, 2014 12:19 AM, "Bram Moolenaar" wrote: > > > ZyX wrote: > > > > The docs are wrong, using "if" is allowed. The other two are not. > > > > Why? It makes parsing impossible. E.g. like indicated by @Yukihiro > > Nakadaira, there is absolutely nothing you can do with this error > > unless

Re: [BUG] ":execute 'if 1'" works like ":if 1"

2014-03-23 Thread Bram Moolenaar
Nikolay Pavlov wrote: > On Mar 23, 2014 12:19 AM, "Bram Moolenaar" wrote: > > > > > > ZyX wrote: > > > > > > The docs are wrong, using "if" is allowed. The other two are not. > > > > > > Why? It makes parsing impossible. E.g. like indicated by @Yukihiro > > > Nakadaira, there is absolutely noth