comparison src/vim9compile.c @ 19566:ec1eeb1b69e2 v8.2.0340

patch 8.2.0340: Vim9: function and partial types not tested Commit: https://github.com/vim/vim/commit/087d2e15184bea3bf455dd266bd6ed66a45396e5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 1 15:36:42 2020 +0100 patch 8.2.0340: Vim9: function and partial types not tested Problem: Vim9: function and partial types not tested. Solution: Support more for partial, add tests.
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Mar 2020 15:45:03 +0100
parents 06f29b6ea04a
children 6b6e97d0185e
comparison
equal deleted inserted replaced
19565:9b03bf56d05e 19566:ec1eeb1b69e2
699 isn_T *isn; 699 isn_T *isn;
700 700
701 if ((isn = generate_instr_type(cctx, ISN_PUSHFUNC, &t_func_void)) == NULL) 701 if ((isn = generate_instr_type(cctx, ISN_PUSHFUNC, &t_func_void)) == NULL)
702 return FAIL; 702 return FAIL;
703 isn->isn_arg.string = name; 703 isn->isn_arg.string = name;
704
705 return OK;
706 }
707
708 /*
709 * Generate an ISN_PUSHPARTIAL instruction with partial "part".
710 * Consumes "name".
711 */
712 static int
713 generate_PUSHPARTIAL(cctx_T *cctx, partial_T *part)
714 {
715 isn_T *isn;
716
717 if ((isn = generate_instr_type(cctx, ISN_PUSHPARTIAL,
718 &t_partial_any)) == NULL)
719 return FAIL;
720 isn->isn_arg.partial = part;
704 721
705 return OK; 722 return OK;
706 } 723 }
707 724
708 /* 725 /*
3603 break; 3620 break;
3604 case VAR_FUNC: 3621 case VAR_FUNC:
3605 generate_PUSHFUNC(cctx, NULL); 3622 generate_PUSHFUNC(cctx, NULL);
3606 break; 3623 break;
3607 case VAR_PARTIAL: 3624 case VAR_PARTIAL:
3608 // generate_PUSHPARTIAL(cctx, NULL); 3625 generate_PUSHPARTIAL(cctx, NULL);
3609 emsg("Partial type not supported yet");
3610 break; 3626 break;
3611 case VAR_LIST: 3627 case VAR_LIST:
3612 generate_NEWLIST(cctx, 0); 3628 generate_NEWLIST(cctx, 0);
3613 break; 3629 break;
3614 case VAR_DICT: 3630 case VAR_DICT:
5226 case ISN_PUSHBLOB: // push blob isn_arg.blob 5242 case ISN_PUSHBLOB: // push blob isn_arg.blob
5227 blob_unref(isn->isn_arg.blob); 5243 blob_unref(isn->isn_arg.blob);
5228 break; 5244 break;
5229 5245
5230 case ISN_PUSHPARTIAL: 5246 case ISN_PUSHPARTIAL:
5231 // TODO 5247 partial_unref(isn->isn_arg.partial);
5232 break; 5248 break;
5233 5249
5234 case ISN_PUSHJOB: 5250 case ISN_PUSHJOB:
5235 #ifdef FEAT_JOB_CHANNEL 5251 #ifdef FEAT_JOB_CHANNEL
5236 job_unref(isn->isn_arg.job); 5252 job_unref(isn->isn_arg.job);