Mercurial > vim
comparison src/vim9execute.c @ 19334:61646c189622 v8.2.0225
patch 8.2.0225: compiling lambda not tested yet
Commit: https://github.com/vim/vim/commit/777770fbb0f3c091cbfa22572b953c0723355710
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 6 21:27:08 2020 +0100
patch 8.2.0225: compiling lambda not tested yet
Problem: compiling lambda not tested yet.
Solution: Add test for lambda and funcref. Drop unused instruction arg.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 06 Feb 2020 21:30:03 +0100 |
parents | e99e6d794597 |
children | 8ff84bc1c89b |
comparison
equal
deleted
inserted
replaced
19333:2de8257d69b8 | 19334:61646c189622 |
---|---|
999 tv = STACK_TV_BOT(-1); | 999 tv = STACK_TV_BOT(-1); |
1000 jump = tv2bool(tv); | 1000 jump = tv2bool(tv); |
1001 if (when == JUMP_IF_FALSE | 1001 if (when == JUMP_IF_FALSE |
1002 || when == JUMP_AND_KEEP_IF_FALSE) | 1002 || when == JUMP_AND_KEEP_IF_FALSE) |
1003 jump = !jump; | 1003 jump = !jump; |
1004 if (when == JUMP_IF_FALSE || when == JUMP_IF_TRUE | 1004 if (when == JUMP_IF_FALSE || !jump) |
1005 || !jump) | |
1006 { | 1005 { |
1007 // drop the value from the stack | 1006 // drop the value from the stack |
1008 clear_tv(tv); | 1007 clear_tv(tv); |
1009 --ectx.ec_stack.ga_len; | 1008 --ectx.ec_stack.ga_len; |
1010 } | 1009 } |
1581 clear_tv(STACK_TV(idx)); | 1580 clear_tv(STACK_TV(idx)); |
1582 vim_free(ectx.ec_stack.ga_data); | 1581 vim_free(ectx.ec_stack.ga_data); |
1583 return ret; | 1582 return ret; |
1584 } | 1583 } |
1585 | 1584 |
1586 #define DISASSEMBLE 1 | |
1587 | |
1588 /* | 1585 /* |
1589 * ":dissassemble". | 1586 * ":dissassemble". |
1587 * We don't really need this at runtime, but we do have tests that require it, | |
1588 * so always include this. | |
1590 */ | 1589 */ |
1591 void | 1590 void |
1592 ex_disassemble(exarg_T *eap) | 1591 ex_disassemble(exarg_T *eap) |
1593 { | 1592 { |
1594 #ifdef DISASSEMBLE | |
1595 char_u *fname; | 1593 char_u *fname; |
1596 ufunc_T *ufunc; | 1594 ufunc_T *ufunc; |
1597 dfunc_T *dfunc; | 1595 dfunc_T *dfunc; |
1598 isn_T *instr; | 1596 isn_T *instr; |
1599 int current; | 1597 int current; |
1837 | 1835 |
1838 switch (iptr->isn_arg.jump.jump_when) | 1836 switch (iptr->isn_arg.jump.jump_when) |
1839 { | 1837 { |
1840 case JUMP_ALWAYS: | 1838 case JUMP_ALWAYS: |
1841 when = "JUMP"; | 1839 when = "JUMP"; |
1842 break; | |
1843 case JUMP_IF_TRUE: | |
1844 when = "JUMP_IF_TRUE"; | |
1845 break; | 1840 break; |
1846 case JUMP_AND_KEEP_IF_TRUE: | 1841 case JUMP_AND_KEEP_IF_TRUE: |
1847 when = "JUMP_AND_KEEP_IF_TRUE"; | 1842 when = "JUMP_AND_KEEP_IF_TRUE"; |
1848 break; | 1843 break; |
1849 case JUMP_IF_FALSE: | 1844 case JUMP_IF_FALSE: |
1995 break; | 1990 break; |
1996 | 1991 |
1997 case ISN_DROP: smsg("%4d DROP", current); break; | 1992 case ISN_DROP: smsg("%4d DROP", current); break; |
1998 } | 1993 } |
1999 } | 1994 } |
2000 #endif | |
2001 } | 1995 } |
2002 | 1996 |
2003 /* | 1997 /* |
2004 * Return TRUE when "tv" is not falsey: non-zero, non-empty string, non-empty | 1998 * Return TRUE when "tv" is not falsey: non-zero, non-empty string, non-empty |
2005 * list, etc. Mostly like what JavaScript does, except that empty list and | 1999 * list, etc. Mostly like what JavaScript does, except that empty list and |